HomeFreeBSD

if_tuntap: add a busy/unbusy mechanism, replace destroy OPEN check

Description

if_tuntap: add a busy/unbusy mechanism, replace destroy OPEN check

A future commit will create device aliases when a tuntap device is renamed
so that it's still easily found in /dev after the rename. Said mechanism
will want to keep the tun alive long enough to either realize that it's
about to go away or complete the alias creation, even if the alias is about
to get destroyed.

While we're introducing it, using it to prevent open devices from going away
makes plenty of sense and keeps the logic on waking up tun_destroy clean, so
we don't have multiple places trying to cv_broadcast unless it's still in
use elsewhere.

Details

Provenance
kevansAuthored on
Parents
rS353055: MFC r352220:
Branches
Unknown
Tags
Unknown