Kristof Provost 9ce40d321d bpf: Fix incorrect cleanup
Cleaning up a bpf_if is a two stage process. We first move it to the
bpf_freelist (in bpfdetach()) and only later do we actually free it (in
bpf_ifdetach()).

We cannot set the ifp->if_bpf to NULL from bpf_ifdetach() because it's
possible that the ifnet has already gone away, or that it has been assigned
a new bpf_if.
This can lead to a struct ifnet which is up, but has if_bpf set to NULL,
which will panic when we try to send the next packet.

Keep track of the pointer to the bpf_if (because it's not always
ifp->if_bpf), and NULL it immediately in bpfdetach().

PR:		213896
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11782
2017-08-16 19:40:07 +00:00
..
2017-05-23 09:29:05 +00:00
2017-08-09 09:13:15 +00:00
2017-08-15 15:20:04 +00:00
2017-07-09 13:53:32 +00:00
2017-08-15 06:01:36 +00:00
2017-08-16 19:40:07 +00:00
2017-08-09 10:46:34 +00:00
2017-05-23 09:29:05 +00:00
2017-06-08 21:30:34 +00:00
2017-05-09 05:08:47 +00:00
2017-08-16 08:49:11 +00:00