summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-01 13:38:19 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-09-01 13:40:16 +0200
commitb35dc5fc8177216f095524431a5a63bd6a4cb9d3 (patch)
treea851c49d31e5999a3bbd8f0cd0f1e4cb6ddec347
parentd94d58c523c24b4c41cefe8bb19bb265960fff48 (diff)
Fix (2) change in ss7 server default listen addr, keeps backward-compatibility behavior
This patch is a fixup or extension of commit 96d348efbf29888f5ef923251c7d51d45a897c0b, which only fixed the default values for "asp" VTY node, but not for the xua server's "listen" node. As a result, without this patch, by default the SCTP server socket will only listen on IPv4's "0.0.0.0", since NULL is resolved by getaddrinfo to it instead of "::" as first candidate. Fixes: 96d348efbf29888f5ef923251c7d51d45a897c0b Change-Id: Ifbc8df854d1f1e9b07b11911ad5da8cdf9f2080a
-rw-r--r--src/osmo_ss7_vty.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 3035844..109b94a 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1871,8 +1871,13 @@ int osmo_ss7_vty_go_parent(struct vty *vty)
case L_CS7_XUA_NODE:
oxs = vty->index;
/* If no local addr was set, or erased after _create(): */
- if (!oxs->cfg.local.host_cnt)
- osmo_ss7_xua_server_set_local_host(oxs, NULL);
+ if (!oxs->cfg.local.host_cnt) {
+ /* "::" Covers both IPv4 and IPv6 */
+ if (ipv6_sctp_supported("::", true))
+ osmo_ss7_xua_server_set_local_host(oxs, "::");
+ else
+ osmo_ss7_xua_server_set_local_host(oxs, "0.0.0.0");
+ }
if (osmo_ss7_xua_server_bind(oxs) < 0)
vty_out(vty, "%% Unable to bind xUA server to IP(s)%s", VTY_NEWLINE);
vty->node = L_CS7_NODE;