aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-08-20 12:33:35 +0200
committerlaforge <laforge@osmocom.org>2020-08-24 07:44:38 +0000
commitc84702c571041dd523713e2b22178a1819517ea9 (patch)
tree891db1c9abd74945b73a8180e70853f729ec57ee
parent4d75559dad449ff422bbd2efe045cd415473adf5 (diff)
Change default SCTP conn NULL->127.0.0.1 to localhost->localhost
"127.0.0.1" is changed to "localhost" to let local NSS decide whether to use IPv4 or IPv6. In newish systems, IPv6 ::1 will be selected since IPv6 takes precedence over IPv4. Similarly, the default source addr needs to be changed from NULL to "localhost" since for some yet unknwon reason, getaddrinfo(AF_UNSPEC, NULL) returns first IPv4 "0.0.0.0" and later "::", which is inconsistent with getaddrinfo("localhost") result, resulting in src=IPv4(0.0.0.0) and dst=IPv6(::1), which is incompatible and will fail. In any case, since the default remote address is a local one and it's the client side, there's no real logical change since the kernel would anyway should have taken a local address anyway. Change-Id: I05a5c792ab1d053c6f38ba36d4b9fa6db293fbd0
-rw-r--r--src/osmo-msc/msc_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index 98d29c3cc..4cda39509 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -329,7 +329,8 @@ static struct vty_app_info msc_vty_info = {
.is_config_node = msc_vty_is_config_node,
};
-#define DEFAULT_M3UA_REMOTE_IP "127.0.0.1"
+#define DEFAULT_M3UA_LOCAL_IP "localhost"
+#define DEFAULT_M3UA_REMOTE_IP "localhost"
#define DEFAULT_PC "0.23.1"
static struct osmo_sccp_instance *sccp_setup(void *ctx, uint32_t cs7_instance,
@@ -341,7 +342,7 @@ static struct osmo_sccp_instance *sccp_setup(void *ctx, uint32_t cs7_instance,
return osmo_sccp_simple_client_on_ss7_id(ctx, cs7_instance, label, default_pc,
OSMO_SS7_ASP_PROT_M3UA,
- 0, NULL, /* local: use arbitrary port and 0.0.0.0. */
+ 0, DEFAULT_M3UA_LOCAL_IP, /* local: use arbitrary port and 0.0.0.0. */
0, /* remote: use protocol default port */
DEFAULT_M3UA_REMOTE_IP);
/* Note: If a differing remote IP is to be used, it was already entered in the vty config at