diff options
author | Stefan Metzmacher <metze@samba.org> | 2021-02-17 11:41:38 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2021-03-15 08:04:58 +0100 |
commit | 2cf4c543d614e3263fa261e4584716d5b7771f09 (patch) | |
tree | 551639077da9a1efc267b045001a726f6aecdbf9 | |
parent | 85b51c275dfef9318f9fe76190a09ddd3a02ddc5 (diff) | |
download | socket_wrapper-2cf4c543d614e3263fa261e4584716d5b7771f09.tar.gz socket_wrapper-2cf4c543d614e3263fa261e4584716d5b7771f09.tar.xz socket_wrapper-2cf4c543d614e3263fa261e4584716d5b7771f09.zip |
swrap: warn about unreachable addresses
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14640
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r-- | src/socket_wrapper.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index a950a0a..b6c7637 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -2027,6 +2027,13 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i type = u_type; iface = (addr & 0x000000FF); } else { + char str[256] = {0,}; + inet_ntop(inaddr->sa_family, + &in->sin_addr, + str, sizeof(str)); + SWRAP_LOG(SWRAP_LOG_WARN, + "str[%s] prt[%u]", + str, (unsigned)prt); errno = ENETUNREACH; return -1; } @@ -2062,6 +2069,13 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i if (IN6_ARE_ADDR_EQUAL(&cmp1, &cmp2)) { iface = in->sin6_addr.s6_addr[15]; } else { + char str[256] = {0,}; + inet_ntop(inaddr->sa_family, + &in->sin6_addr, + str, sizeof(str)); + SWRAP_LOG(SWRAP_LOG_WARN, + "str[%s] prt[%u]", + str, (unsigned)prt); errno = ENETUNREACH; return -1; } |