diff options
author | bz <bz@FreeBSD.org> | 2006-12-12 12:17:58 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2006-12-12 12:17:58 +0000 |
commit | 297206ec2ac5b34686aaf531476b1b737df9bbd7 (patch) | |
tree | 262eb78fb028423e6796d76401691a45b39b496a /sys/netinet/tcp_input.c | |
parent | dc3e4a0741ba505defdc796a954461de7aa856e3 (diff) | |
download | FreeBSD-src-297206ec2ac5b34686aaf531476b1b737df9bbd7.zip FreeBSD-src-297206ec2ac5b34686aaf531476b1b737df9bbd7.tar.gz |
MFp4: 92972, 98913 + one more change
In ip6_sprintf no longer use and return one of eight static buffers
for printing/logging ipv6 addresses.
The caller now has to hand in a sufficiently large buffer as first
argument.
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9aef64b..79d5e86 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -454,6 +454,7 @@ tcp_input(m, off0) struct ip6_hdr *ip6 = NULL; #ifdef INET6 int isipv6; + char ip6buf[INET6_ADDRSTRLEN]; #else const int isipv6 = 0; #endif @@ -712,8 +713,10 @@ findpcb: #ifdef INET6 strcpy(dbuf, "["); strcpy(sbuf, "["); - strcat(dbuf, ip6_sprintf(&ip6->ip6_dst)); - strcat(sbuf, ip6_sprintf(&ip6->ip6_src)); + strcat(dbuf, + ip6_sprintf(ip6buf, &ip6->ip6_dst)); + strcat(sbuf, + ip6_sprintf(ip6buf, &ip6->ip6_src)); strcat(dbuf, "]"); strcat(sbuf, "]"); #endif @@ -1069,7 +1072,8 @@ after_listen: "dropping connection\n", #ifdef INET6 isipv6 ? - ip6_sprintf(&inp->inp_inc.inc6_faddr) : + ip6_sprintf(ip6buf, + &inp->inp_inc.inc6_faddr) : #endif inet_ntoa(inp->inp_inc.inc_faddr), inp->inp_inc.inc_fport, |