summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian S.J. Peron <csjp@FreeBSD.org>2008-03-24 13:50:39 +0000
committerChristian S.J. Peron <csjp@FreeBSD.org>2008-03-24 13:50:39 +0000
commit582908b314a6c22bb3371eca434528bc6d305f07 (patch)
treebd81d6c56c6ab0a3ae997225a5d10525a81e3484
parent4d621040ff9fbefb725b9be28449e0efba8d43c7 (diff)
Notes
-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 0b79a7661c78..4455d04d618f 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);