freebsd-dev/sys
Kyle Evans 59997c3c46 if_tuntap: create /dev aliases when a tuntap device gets renamed
Currently, if you do:

$ ifconfig tun0 create
$ ifconfig tun0 name wg0
$ ls -l /dev | egrep 'wg|tun'

You will see tun0, but no wg0. In fact, it's slightly more annoying to make
the association between the new name and the old name in order to open the
device (if it hadn't been opened during the rename).

Register an eventhandler for ifnet_arrival_events and catch interface
renames. We can determine if the ifnet is a tun easily enough from the
if_dname, which matches the cevsw.d_name from the associated tuntap_driver.

Some locking dance is required because renames don't require the device to
be opened, so it could go away in the middle of handling the ioctl, but as
soon as we've verified this isn't the case we can attempt to busy the tun
and either bail out if the tun device is dying, or we can proceed with the
rename.

We only create these aliases on a best-effort basis. Renaming a tun device
to "usbctl", which doesn't exist as an ifnet but does as a /dev, is clearly
not that disastrous, but we can't and won't create a /dev for that.
2019-10-03 17:54:00 +00:00
..
amd64 Remove host binary object drivers from GENERIC 2019-10-03 12:51:57 +00:00
arm arm: allwinner: a10_ehci: Enable all phys 2019-10-01 22:19:12 +00:00
arm64 arm64: rockchip: rk805: Switch to iicdev_{readfrom,writeto} 2019-10-01 18:30:06 +00:00
bsm
cam Add kern.cam.da.X.quirks tunable, similar existing for ada. 2019-09-26 14:48:39 +00:00
cddl ZFS: add bookmark renaming 2019-10-03 11:08:45 +00:00
compat Regen after r347228 and r352693. 2019-09-30 21:00:19 +00:00
conf Fix the EMBEDFS_FORMAT helper variable for riscv64. 2019-10-02 21:49:39 +00:00
contrib Notify all sleeping threads of device removal in krping. 2019-10-02 09:03:48 +00:00
crypto Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
ddb ddb(4): Add some support for lexing IPv6 addresses 2019-09-09 16:32:23 +00:00
dev nvdimm: Fix error path mis-free 2019-10-02 19:13:35 +00:00
dts
fs Remove unnecessary vm/vm_page.h and vm/vm_pager.h includes from 2019-10-03 08:25:09 +00:00
gdb gdb(4): Root a sysctl tree at 'debug.gdb.' 2019-09-08 22:52:47 +00:00
geom Add a "count_until_fail" option to gnop, which says to start failing 2019-09-13 23:03:56 +00:00
gnu Import DTS files from Linux 5.3 2019-09-28 23:08:19 +00:00
i386 Remove host binary object drivers from GENERIC 2019-10-03 12:51:57 +00:00
isa
kern simplify path handling in sysctl_try_reclaim_vnode 2019-10-02 21:01:23 +00:00
kgssapi Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
libkern
mips mips: use generic sub-word atomic *cmpset 2019-10-02 17:07:59 +00:00
modules Harmonize the hptmv blob's build rule with that of other hpt* drivers. 2019-10-02 16:18:50 +00:00
net if_tuntap: create /dev aliases when a tuntap device gets renamed 2019-10-03 17:54:00 +00:00
net80211
netgraph Fix build failure from r353026. Somehow module build allowed this. 2019-10-03 04:41:57 +00:00
netinet Don't use stack memory which is not initialized. 2019-09-30 12:06:57 +00:00
netinet6 When processing an incoming IPv6 packet over the loopback interface which 2019-09-19 10:22:29 +00:00
netipsec Fix broken window replay check that will allow old packet to be accepted. 2019-09-06 14:30:23 +00:00
netpfil Drivers may pass runt packets to filter. This is okay. 2019-09-13 22:36:04 +00:00
netsmb Stop using des_cblock * for arguments to DES functions. 2019-08-26 17:25:07 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Make sure the transmit loop doesn't get starved in ipoib. 2019-10-02 09:06:13 +00:00
opencrypto kTLS support for TLS 1.3 2019-09-27 19:17:40 +00:00
powerpc powerpc/booke64: Align initial stack setting to match that of aim64's 2019-09-28 03:33:07 +00:00
riscv Implement pmap_page_is_mapped() correctly on arm64 and riscv. 2019-09-27 23:37:01 +00:00
rpc
security
sparc64 sparc64: use generic sub-word atomic *cmpset 2019-10-02 17:08:20 +00:00
sys Provide generic sub-word atomic *cmpset 2019-10-02 17:06:28 +00:00
teken Adjust teken to allow build as part of loader 2019-09-05 18:07:40 +00:00
tests
tools fw_stub.awk: use @generated tag in generated files 2019-09-11 13:35:22 +00:00
ufs vfs: convert struct mount counters to per-cpu 2019-09-16 21:37:47 +00:00
vm Improve MD page fault handlers. 2019-09-27 18:43:36 +00:00
x86 Complete the removal of the "wire_count" field from struct vm_page. 2019-09-25 16:11:35 +00:00
xdr
xen
Makefile