Fix reporting of src and dst IP addresses for ICMP and generic IP packets.

PR:		17319
Submitted by:	Mike Heffner <spock@techfour.net>
This commit is contained in:
Ruslan Ermilov 2000-03-14 14:11:53 +00:00
parent 612a914d90
commit d137714f11
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58057

View file

@ -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;
}