summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorlstewart <lstewart@FreeBSD.org>2012-01-10 00:48:29 +0000
committerlstewart <lstewart@FreeBSD.org>2012-01-10 00:48:29 +0000
commit15b1ff36092f77e72af4a2a0ea1ac76d6c89542f (patch)
tree163b8ae7160d4b3a8a93f6686be6c70e99d94f01 /libexec
parentff2010b86c6b67928c735d9fb6d3144308dda880 (diff)
downloadFreeBSD-src-15b1ff36092f77e72af4a2a0ea1ac76d6c89542f.zip
FreeBSD-src-15b1ff36092f77e72af4a2a0ea1ac76d6c89542f.tar.gz
Consumers of bpfdetach() expect it to remove all bpf_if structs from the
bpf_iflist list which reference the specified ifnet. The existing implementation only removes the first matching bpf_if found in the list, effectively leaking list entries if an ifnet has been bpfattach()ed multiple times with different DLTs. Fix the leak by performing the detach logic in a loop, stopping when all bpf_if structs referencing the specified ifnet have been detached and removed from the bpf_iflist list. Whilst here, also: - Remove the unnecessary "bp->bif_ifp == NULL" check, as a bpf_if should never exist in the list with a NULL ifnet pointer. - Except when INVARIANTS is in the kernel config, silently ignore the case where no bpf_if referencing the specified ifnet is found, as it is harmless and does not require user attention. Reviewed by: csjp MFC after: 1 week
Diffstat (limited to 'libexec')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud