summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2008-03-24 13:50:39 +0000
committercsjp <csjp@FreeBSD.org>2008-03-24 13:50:39 +0000
commit95b0fc53fd9bf0f1626ac4dad7dc68f84b188343 (patch)
treebd81d6c56c6ab0a3ae997225a5d10525a81e3484
parent310e3f93ddb4d35429a892af85c9b1cf4ef64ebe (diff)
downloadFreeBSD-src-95b0fc53fd9bf0f1626ac4dad7dc68f84b188343.zip
FreeBSD-src-95b0fc53fd9bf0f1626ac4dad7dc68f84b188343.tar.gz
Catch netstat up for the new bpf stats structures. Print 64 bit values
properly. Sponsored by: Seccuris Inc MFC after: 4 months
-rw-r--r--usr.bin/netstat/bpf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/netstat/bpf.c b/usr.bin/netstat/bpf.c
index 0b79a76..4455d04 100644
--- a/usr.bin/netstat/bpf.c
+++ b/usr.bin/netstat/bpf.c
@@ -113,15 +113,19 @@ bpf_stats(char *ifname)
free(bd);
return;
}
- printf("%5s %6s %7s %9s %9s %9s %5s %5s %s\n",
+ (void) printf("%5s %6s %7s %9s %9s %9s %5s %5s %s\n",
"Pid", "Netif", "Flags", "Recv", "Drop", "Match", "Sblen",
"Hblen", "Command");
for (d = &bd[0]; d < &bd[size / sizeof(*d)]; d++) {
+ if (d->bd_structsize != sizeof(*d)) {
+ warnx("bpf_stats_extended: version mismatch");
+ return;
+ }
if (ifname && strcmp(ifname, d->bd_ifname) != 0)
continue;
bpf_flags(d, flagbuf);
pname = bpf_pidname(d->bd_pid);
- printf("%5d %6s %7s %9lu %9lu %9lu %5d %5d %s\n",
+ (void) printf("%5d %6s %7s %9ju %9ju %9ju %5d %5d %s\n",
d->bd_pid, d->bd_ifname, flagbuf,
d->bd_rcount, d->bd_dcount, d->bd_fcount,
d->bd_slen, d->bd_hlen, pname);
OpenPOWER on IntegriCloud