summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-10-23 19:23:04 +0200
committerlaforge <laforge@osmocom.org>2019-10-23 18:10:10 +0000
commit1870752ca7c1665731750d2c8288c148cf348b56 (patch)
tree08ed1e8d1f461c3dff46f99c89240840bb1ca1a7
parentf0a0a4cdd78e97dc1462dbb2117c4681e471ebde (diff)
vty: ss7: Make sure ASP has at least INET_ANY addr set if not configured in VTY
Several parts of the code expect an operative ASP to always have at least one local ip addr, be it INET_ANY (NULL, 0.0.0.0) or any specific IP address. This allows osmo_ss7_asp_find_by_socket_addr() matching incoming connectiongs against ASPs defined through VTY "asp" node with no "local-ip" cmd option specified. In that case, we assume the user wants it to bind/match against INET_ANY. Related: OS#3608 Fixes: 80b135581909fef595d48436ab04dbcb147e3895 Change-Id: Id4da0c778890c90cf5bfcf0fd3a7ecf165f2a6df
-rw-r--r--src/osmo_ss7_vty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 23607ca..fa3d5d1 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1722,6 +1722,11 @@ int osmo_ss7_vty_go_parent(struct vty *vty)
switch (vty->node) {
case L_CS7_ASP_NODE:
asp = vty->index;
+ /* If no local addr was set */
+ if (!asp->cfg.local.host_cnt) {
+ asp->cfg.local.host[0] = NULL;
+ asp->cfg.local.host_cnt = 1;
+ }
osmo_ss7_asp_restart(asp);
vty->node = L_CS7_NODE;
vty->index = asp->inst;