diff options
author | rwatson <rwatson@FreeBSD.org> | 2000-03-19 05:42:34 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2000-03-19 05:42:34 +0000 |
commit | 5b7df33ce063503bdebb25d8f4026d194b5d636b (patch) | |
tree | bf2dd5113226273c2841422f0a442c00aa36b9ff /sys/netinet/libalias/alias.c | |
parent | eab2bd6865d76d43c2ecc87aadaa72eb5e965499 (diff) | |
download | FreeBSD-src-5b7df33ce063503bdebb25d8f4026d194b5d636b.zip FreeBSD-src-5b7df33ce063503bdebb25d8f4026d194b5d636b.tar.gz |
The advent of if_detach, allowing interface removal at runtime, makes it
possible for a panic to occur if BPF is in use on the interface at the
time of the call to if_detach. This happens because BPF maintains pointers
to the struct ifnet describing the interface, which is freed by if_detach.
To correct this problem, a new call, bpfdetach, is introduced. bpfdetach
locates BPF descriptor references to the interface, and NULLs them. Other
BPF code is modified so that discovery of a NULL interface results in
ENXIO (already implemented for some calls). Processes blocked on a BPF
call will also be woken up so that they can receive ENXIO.
Interface drivers that invoke bpfattach and if_detach must be modified to
also call bpfattach(ifp) before calling if_detach(ifp). This is relevant
for buses that support hot removal, such as pccard and usb. Patches to
all effected devices will not be committed, only to if_wi.c, due to
testing limitations. To reproduce the crash, load up tcpdump on you
favorite pccard ethernet card, and then eject the card. As some pccard
drivers do not invoke if_detach(ifp), this bug will not manifest itself
for those drivers.
Reviewed by: wes
Diffstat (limited to 'sys/netinet/libalias/alias.c')
0 files changed, 0 insertions, 0 deletions