FreeBSD/src 2b9600b (r332812)sys/net bpf.c

Add dead_bpf_if structure, that should be used as fake bpf_if
during ifnet detach.

Since destroying interface is not atomic operation and due to the
lack of synhronization during destroy, it is possible, that in the
time between bpfdetach() and if_free() some queued on destroying
interface mbuf will be used by ether_input_internal() and
bpf_peers_present() can dereference NULL bpf_if pointer. To protect
from this, assign pointer to empty bpf_if_ext structure instead of
NULL pointer after bpfdetach().

Reviewed by:    melifaro, eugen
Obtained from:  Yandex LLC
MFC after:      1 week
Sponsored by:   Yandex LLC
Differential Revision:  https://reviews.freebsd.org/D15083
DeltaFile
+5-1sys/net/bpf.c
+5-11 files

UnifiedSplitRaw