From: Christian Grothoff Date: Sun, 18 Oct 2015 18:29:04 +0000 (+0000) Subject: -fix reporting of IP address X-Git-Tag: initial-import-from-subversion-38251~1239 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=70d9f0a4f731f35032cc84a85436dbd17c498260;p=oweals%2Fgnunet.git -fix reporting of IP address --- diff --git a/src/nat/nat.c b/src/nat/nat.c index d41f3fab8..200636e97 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c @@ -1960,6 +1960,7 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, struct LocalAddressList *pos; const struct sockaddr_in *in4; const struct sockaddr_in6 *in6; + char pbuf[INET6_ADDRSTRLEN+1]; if ((addrlen != sizeof (struct in_addr)) && (addrlen != sizeof (struct in6_addr))) @@ -1990,8 +1991,11 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, } LOG (GNUNET_ERROR_TYPE_WARNING, "Asked to validate one of my addresses (%s) and validation failed!\n", - GNUNET_a2s (addr, - addrlen)); + inet_ntop ((addrlen == sizeof(struct in_addr)) + ? AF_INET + : AF_INET6, + addr, + pbuf, sizeof (pbuf))); return GNUNET_NO; }