diff options
| author | Christian S.J. Peron <csjp@FreeBSD.org> | 2009-06-19 20:31:44 +0000 |
|---|---|---|
| committer | Christian S.J. Peron <csjp@FreeBSD.org> | 2009-06-19 20:31:44 +0000 |
| commit | 0e37f3e196c6cb887be0de58c315aa1358caa363 (patch) | |
| tree | 542c6420562d89c40cfcd91ff45fb324162ae4d1 /usr.bin/netstat/bpf.c | |
| parent | 80b807fef2ba25a13619abc65eb8b47b7ea352d1 (diff) | |
Notes
Diffstat (limited to 'usr.bin/netstat/bpf.c')
| -rw-r--r-- | usr.bin/netstat/bpf.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/netstat/bpf.c b/usr.bin/netstat/bpf.c index 4455d04d618f..2ffeacbc7dea 100644 --- a/usr.bin/netstat/bpf.c +++ b/usr.bin/netstat/bpf.c @@ -91,10 +91,17 @@ bpf_flags(struct xbpf_d *bd, char *flagbuf) void bpf_stats(char *ifname) { - struct xbpf_d *d, *bd; + struct xbpf_d *d, *bd, zerostat; char *pname, flagbuf[12]; size_t size; + if (zflag) { + bzero(&zerostat, sizeof(zerostat)); + if (sysctlbyname("net.bpf.stats", NULL, NULL, + &zerostat, sizeof(zerostat)) < 0) + warn("failed to zero bpf counters"); + return; + } if (sysctlbyname("net.bpf.stats", NULL, &size, NULL, 0) < 0) { warn("net.bpf.stats"); |
