-fix reporting of IP address
authorChristian Grothoff <christian@grothoff.org>
Sun, 18 Oct 2015 18:29:04 +0000 (18:29 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 18 Oct 2015 18:29:04 +0000 (18:29 +0000)
src/nat/nat.c

index d41f3fab8b786803f7db3749c295c5f2d905f3af..200636e97146738651009e710e56ceabbb40ed36 100644 (file)
@@ -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;
 }