HomeFreeBSD

tun(4): Defer clearing TUN_OPEN until much later

Description

tun(4): Defer clearing TUN_OPEN until much later

tun destruction will not continue until TUN_OPEN is cleared. There are brief
moments in tunclose where the mutex is dropped and we've already cleared
TUN_OPEN, so tun_destroy would be able to proceed while we're in the middle
of cleaning up the tun still. tun_destroy should be blocked until these
parts (address/route purges, mostly) are complete.

PR: 233955
MFC after: 2 weeks

Details

Provenance
kevansAuthored on
Parents
rS346601: ip6_randomflowlabel: Avoid blocking if random(4) is not available
Branches
Unknown
Tags
Unknown