HomeFreeBSD

tuntap(4): Use make_dev_s to avoid si_drv1 race

Description

tuntap(4): Use make_dev_s to avoid si_drv1 race

This allows us to avoid some dance in tunopen for dealing with the
possibility of dev->si_drv1 being NULL as it's set prior to the devfs node
being created in all cases.

There's still the possibility that the tun device hasn't been fully
initialized, since that's done after the devfs node was created. Alleviate
this by returning ENXIO if we're not to that point of tuncreate yet.

This work is what sparked r353128, full initialization of cloned devices
w/ specified make_dev_args.

Details

Provenance
kevansAuthored on
Parents
rS353784: MFC r353644, r353646, r353663: bectl(8) origin auto-destroy
Branches
Unknown
Tags
Unknown