mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
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:
parent
612a914d90
commit
d137714f11
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58057
1 changed files with 6 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue