aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/osmo_bsc_sigtran.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-08-20 12:32:54 +0200
committerpespin <pespin@sysmocom.de>2020-08-25 13:50:06 +0000
commit551321ec722349fe52d956fef3f41bb01488b7af (patch)
tree6df38042fb4659fb9be58fca60779ae46341b90e /src/osmo-bsc/osmo_bsc_sigtran.c
parent6adb24693b9ea93e6d6b2761d3fb6b6435bb3662 (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: Ic93be6c47403e65b7c338604728570f23bc3de12
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_sigtran.c')
-rw-r--r--src/osmo-bsc/osmo_bsc_sigtran.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 657413ad9..9d9e40a35 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -41,7 +41,8 @@
* (a copy of the pointer location submitted with osmo_bsc_sigtran_init() */
static struct llist_head *msc_list;
-#define DEFAULT_ASP_REMOTE_IP "127.0.0.1"
+#define DEFAULT_ASP_LOCAL_IP "localhost"
+#define DEFAULT_ASP_REMOTE_IP "localhost"
/* The SCCP stack will not assign connection IDs to us automatically, we
* will do this ourselves using a counter variable, that counts one up
@@ -566,7 +567,9 @@ int osmo_bsc_sigtran_init(struct llist_head *mscs)
/* SS7 Protocol stack */
default_pc = osmo_ss7_pointcode_parse(NULL, BSC_DEFAULT_PC);
- sccp = osmo_sccp_simple_client_on_ss7_id(tall_bsc_ctx, inst->cfg.id, inst_name, default_pc, used_proto, 0, NULL,
+ sccp = osmo_sccp_simple_client_on_ss7_id(tall_bsc_ctx, inst->cfg.id, inst_name,
+ default_pc, used_proto,
+ 0, DEFAULT_ASP_LOCAL_IP,
0, DEFAULT_ASP_REMOTE_IP);
if (!sccp)
return -EINVAL;