From c67126afe50e544376680c704825353644f9ea50 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 21 May 2010 07:44:16 +0000 Subject: [PATCH] properly print v6 addrs --- src/transport/plugin_transport_tcp.c | 4 ++-- src/transport/transport.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index fe0f18597..5aa1b8c2f 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -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; diff --git a/src/transport/transport.h b/src/transport/transport.h index 5ce11ad68..b2ef01bb5 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -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 -- 2.25.1