diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_fw2.c | 10 | ||||
-rw-r--r-- | sys/netinet/tcp_hostcache.c | 5 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 10 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 10 |
4 files changed, 24 insertions, 11 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 diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index 7535d31..f4c7a68 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -587,6 +587,9 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) char *p, *buf; int len, i, error; struct hc_metrics *hc_entry; +#ifdef INET6 + char ip6buf[INET6_ADDRSTRLEN]; +#endif bufsize = linesize * (tcp_hostcache.cache_count + 1); @@ -607,7 +610,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) "%4lu %4lu %4i\n", hc_entry->ip4.s_addr ? inet_ntoa(hc_entry->ip4) : #ifdef INET6 - ip6_sprintf(&hc_entry->ip6), + ip6_sprintf(ip6buf, &hc_entry->ip6), #else "IPv6?", #endif 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, diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 9aef64b..79d5e86 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.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, |