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/ip_fw2.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/ip_fw2.c')
-rw-r--r-- | sys/netinet/ip_fw2.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index a435d03..591e6ff 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -886,10 +886,11 @@ ipfw_log(struct ip_fw *f, u_int hlen, struct ip_fw_args *args, dst[0] = '\0'; #ifdef INET6 if (IS_IP6_FLOW_ID(&(args->f_id))) { + char ip6buf[INET6_ADDRSTRLEN]; snprintf(src, sizeof(src), "[%s]", - ip6_sprintf(&args->f_id.src_ip6)); + ip6_sprintf(ip6buf, &args->f_id.src_ip6)); snprintf(dst, sizeof(dst), "[%s]", - ip6_sprintf(&args->f_id.dst_ip6)); + ip6_sprintf(ip6buf, &args->f_id.dst_ip6)); ip6 = (struct ip6_hdr *)mtod(m, struct ip6_hdr *); tcp = (struct tcphdr *)(mtod(args->m, char *) + hlen); @@ -1529,11 +1530,12 @@ install_state(struct ip_fw *rule, ipfw_insn_limit *cmd, * supported yet. */ if (IS_IP6_FLOW_ID(&(args->f_id))) { + char ip6buf[INET6_ADDRSTRLEN]; snprintf(src, sizeof(src), - "[%s]", ip6_sprintf( + "[%s]", ip6_sprintf(ip6buf, &args->f_id.src_ip6)); snprintf(dst, sizeof(dst), - "[%s]", ip6_sprintf( + "[%s]", ip6_sprintf(ip6buf, &args->f_id.dst_ip6)); } else #endif |