summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2000-03-14 20:35:20 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2000-03-14 20:35:20 +0000
commit0a7d464a504f6250db61ce48c53a89e631d59301 (patch)
tree5bfc922652abb5b24a799ff462915aa72df92f89
parentd281aade56d59271978d284cabf9daa78cf59049 (diff)
Notes
-rw-r--r--sys/netinet/ip_fw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 31da781916333..94826659dca33 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -464,7 +464,6 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
}
}
- len = 0;
switch (ip->ip_p) {
case IPPROTO_TCP:
len = snprintf(SNPARGS(proto, 0), "TCP %s",
@@ -500,12 +499,14 @@ ipfw_report(struct ip_fw *f, struct ip *ip,
icmp->icmp_type, icmp->icmp_code);
else
len = snprintf(SNPARGS(proto, 0), "ICMP ");
- snprintf(SNPARGS(proto, len), "%s %s", inet_ntoa(ip->ip_src),
- inet_ntoa(ip->ip_dst));
+ len += snprintf(SNPARGS(proto, len), "%s",
+ inet_ntoa(ip->ip_src));
+ snprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst));
break;
default:
- snprintf(SNPARGS(proto, 0), "P:%d %s %s", ip->ip_p,
- inet_ntoa(ip->ip_src), inet_ntoa(ip->ip_dst));
+ len = snprintf(SNPARGS(proto, 0), "P:%d %s", ip->ip_p,
+ inet_ntoa(ip->ip_src));
+ snprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst));
break;
}