aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-08-20 13:45:40 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-08-21 18:07:26 +0200
commit9074d91451b1ad85a428c9cb723cc6dd91d171f9 (patch)
tree6e6f481b0b4ac979ce8b6448377fee5d3f6c5343
parent9922e083ea645fa05114b4773bbb7671dbb1378c (diff)
Change default SCTP conn NULL->127.0.0.1 to localhost->localhostHEADmaster
"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: I3c07e6aa0c87b752c9ea22eb4936f6993de6571f
-rw-r--r--src/hnbgw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hnbgw.c b/src/hnbgw.c
index a47decd..9e0b33b 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -598,7 +598,7 @@ int main(int argc, char **argv)
ranap_set_log_area(DRANAP);
- rc = hnbgw_cnlink_init(g_hnb_gw, "127.0.0.1", M3UA_PORT, NULL);
+ rc = hnbgw_cnlink_init(g_hnb_gw, "localhost", M3UA_PORT, "localhost");
if (rc < 0) {
LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n");
exit(1);