properly print v6 addrs
authorChristian Grothoff <christian@grothoff.org>
Fri, 21 May 2010 07:44:16 +0000 (07:44 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 21 May 2010 07:44:16 +0000 (07:44 +0000)
src/transport/plugin_transport_tcp.c
src/transport/transport.h

index fe0f185973af477956ac5f61c94800f4116950bc..5aa1b8c2fee8a5fcb252d3d658fc63a3dbd2c989 100644 (file)
@@ -311,7 +311,7 @@ tcp_address_to_string (void *cls,
                       const void *addr,
                       size_t addrlen)
 {
-  static char rbuf[INET6_ADDRSTRLEN + 10];
+  static char rbuf[INET6_ADDRSTRLEN + 12];
   char buf[INET6_ADDRSTRLEN];
   const void *sb;
   struct in_addr a4;
@@ -345,7 +345,7 @@ tcp_address_to_string (void *cls,
   inet_ntop (af, sb, buf, INET6_ADDRSTRLEN);
   GNUNET_snprintf (rbuf,
                   sizeof (rbuf),
-                  "%s:%u",
+                  (af == AF_INET6) ? "[%s]:%u" : "%s:%u",
                   buf,
                   port);
   return rbuf;
index 5ce11ad680ef6702672264bfc99534df4dd898a8..b2ef01bb5c85fc266dc01881654d3159b1a54dd3 100644 (file)
@@ -30,7 +30,7 @@
 #include "gnunet_time_lib.h"
 #include "gnunet_transport_service.h"
 
-#define DEBUG_TRANSPORT GNUNET_NO
+#define DEBUG_TRANSPORT GNUNET_YES
 #define DEBUG_TRANSPORT_TIMEOUT GNUNET_YES
 #define DEBUG_TRANSPORT_DISCONNECT GNUNET_YES