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
This commit is contained in:
Neels Hofmeyr 2020-09-22 00:24:06 +00:00 committed by neels
parent e1c4f24cb9
commit 5761c44609
2 changed files with 9 additions and 5 deletions

View File

@ -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;
}

View File

@ -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