kevans cd7faca79a tuntap: Defer clearing if_softc until after if_detach
r346670 added an sx to close a race between the ifioctl handler and
interface destruction. Unfortunately, it clears if_softc immediately after
the interface is closed, but before if_detach has been invoked.

Any time before detachment, an interface that's part of a bridge may still
receive traffic that's pushed through tunstart/tunstart_l2 and promptly
lead to a panic because if_softc is now NULL.

Fix it by deferring the clearing of if_softc until after the interface has
detached and thus been removed from the bridge. if_softc still gets cleared
in case another thread has already entered the ioctl handler before it's
replaced with ifdead_ioctl.

Reported by:	markj
MFC after:	3 days
2019-05-14 20:32:29 +00:00
..
2018-05-31 09:11:21 +00:00
2019-04-17 17:18:43 +00:00
2019-04-17 17:18:43 +00:00
2019-03-09 01:12:59 +00:00
2019-05-08 02:32:11 +00:00
2019-04-17 17:18:43 +00:00
2018-11-26 13:42:18 +00:00
2019-05-09 11:34:46 +00:00
2019-03-15 11:08:44 +00:00
2018-06-16 19:21:09 +00:00