diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-09-22 00:24:06 +0000 |
---|---|---|
committer | neels <nhofmeyr@sysmocom.de> | 2023-03-14 20:15:05 +0000 |
commit | 5761c446099a3ad69426608de1cc98050b8a0b53 (patch) | |
tree | 6cc2f9b192f45038ca0e00d1de7d8c0b5fae2ce1 | |
parent | contrib/talloc_count.sh: improve hexadecimal masking (diff) | |
download | libosmocore-5761c446099a3ad69426608de1cc98050b8a0b53.tar.xz libosmocore-5761c446099a3ad69426608de1cc98050b8a0b53.zip |
error log: osmo_sock_init2_multiaddr() v4/v6 mix
Provide some more information for the error case when local and remote
addresses mix v4 and v6.
Change-Id: I0fd12b08e0788ce3af6dc519ff8c82ad196a115f
-rw-r--r-- | src/core/socket.c | 6 | ||||
-rw-r--r-- | tests/socket/socket_sctp_test.err | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 9e0f84e3..1b147943 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -776,7 +776,11 @@ int osmo_sock_init2_multiaddr(uint16_t family, uint16_t type, uint8_t proto, if (((flags & OSMO_SOCK_F_BIND) && (flags & OSMO_SOCK_F_CONNECT)) && !addrinfo_has_in6addr_any((const struct addrinfo **)res_loc, local_hosts_cnt) && (loc_has_v4addr != rem_has_v4addr || loc_has_v6addr != rem_has_v6addr)) { - LOGP(DLGLOBAL, LOGL_ERROR, "Invalid v4 vs v6 in local vs remote addresses\n"); + LOGP(DLGLOBAL, LOGL_ERROR, "Invalid v4 vs v6 in local vs remote addresses: " + "local:%s%s remote:%s%s\n", + loc_has_v4addr ? " v4" : "", loc_has_v6addr ? " v6" : "", + rem_has_v4addr ? " v4" : "", rem_has_v6addr ? " v6" : "" + ); rc = -EINVAL; goto ret_freeaddrinfo; } diff --git a/tests/socket/socket_sctp_test.err b/tests/socket/socket_sctp_test.err index 996d0922..7583a2a2 100644 --- a/tests/socket/socket_sctp_test.err +++ b/tests/socket/socket_sctp_test.err @@ -1,8 +1,8 @@ invalid: you have to specify either BIND or CONNECT flags -Invalid v4 vs v6 in local vs remote addresses -Invalid v4 vs v6 in local vs remote addresses +Invalid v4 vs v6 in local vs remote addresses: local: v4 remote: v6 +Invalid v4 vs v6 in local vs remote addresses: local: v6 remote: v4 invalid: you have to specify either BIND or CONNECT flags -Invalid v4 vs v6 in local vs remote addresses -Invalid v4 vs v6 in local vs remote addresses +Invalid v4 vs v6 in local vs remote addresses: local: v4 remote: v6 +Invalid v4 vs v6 in local vs remote addresses: local: v6 remote: v4 getaddrinfo(::1, 0) failed: Address family for hostname not supported getaddrinfo(127.0.0.1, 0) failed: Address family for hostname not supported |