diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-21 07:44:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-21 07:44:16 +0000 |
commit | c67126afe50e544376680c704825353644f9ea50 (patch) | |
tree | 9a7f45d7bd2be090a606d6682985a63e37dd9134 /src/transport/plugin_transport_tcp.c | |
parent | bbf7bf0053e02e5785c2c670184f17433277932a (diff) | |
download | gnunet-c67126afe50e544376680c704825353644f9ea50.tar.gz gnunet-c67126afe50e544376680c704825353644f9ea50.zip |
properly print v6 addrs
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 4 |
1 files changed, 2 insertions, 2 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, | |||
311 | const void *addr, | 311 | const void *addr, |
312 | size_t addrlen) | 312 | size_t addrlen) |
313 | { | 313 | { |
314 | static char rbuf[INET6_ADDRSTRLEN + 10]; | 314 | static char rbuf[INET6_ADDRSTRLEN + 12]; |
315 | char buf[INET6_ADDRSTRLEN]; | 315 | char buf[INET6_ADDRSTRLEN]; |
316 | const void *sb; | 316 | const void *sb; |
317 | struct in_addr a4; | 317 | struct in_addr a4; |
@@ -345,7 +345,7 @@ tcp_address_to_string (void *cls, | |||
345 | inet_ntop (af, sb, buf, INET6_ADDRSTRLEN); | 345 | inet_ntop (af, sb, buf, INET6_ADDRSTRLEN); |
346 | GNUNET_snprintf (rbuf, | 346 | GNUNET_snprintf (rbuf, |
347 | sizeof (rbuf), | 347 | sizeof (rbuf), |
348 | "%s:%u", | 348 | (af == AF_INET6) ? "[%s]:%u" : "%s:%u", |
349 | buf, | 349 | buf, |
350 | port); | 350 | port); |
351 | return rbuf; | 351 | return rbuf; |