diff options
author | csjp <csjp@FreeBSD.org> | 2006-05-07 03:21:43 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2006-05-07 03:21:43 +0000 |
commit | 79b0d24eca099a2505c578785f4a464500d23449 (patch) | |
tree | e94f4437a5abd15e0f7c2640e3479b9ac7f253a5 /sys/net/bpf.c | |
parent | 68fb8bff53f316fc01801d480f502b370650443e (diff) | |
download | FreeBSD-src-79b0d24eca099a2505c578785f4a464500d23449.zip FreeBSD-src-79b0d24eca099a2505c578785f4a464500d23449.tar.gz |
Pickup locks for the BPF interface structure. It's quite possible that
bpf(4) descriptors can be added and removed on this interface while we
are processing stats.
MFC after: 2 weeks
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r-- | sys/net/bpf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index a66bf69..1df92e7 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1813,12 +1813,14 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) } index = 0; LIST_FOREACH(bp, &bpf_iflist, bif_next) { + BPFIF_LOCK(bp); LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { xbd = &xbdbuf[index++]; BPFD_LOCK(bd); bpfstats_fill_xbpf(xbd, bd); BPFD_UNLOCK(bd); } + BPFIF_UNLOCK(bp); } mtx_unlock(&bpf_mtx); error = SYSCTL_OUT(req, xbdbuf, index * sizeof(*xbd)); |