mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 14:54:24 +00:00
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
This commit is contained in:
parent
3baa00b342
commit
1fc9e38706
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158345
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue