]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tun/tap: merge and rename to `tuntap`
authorkevans <kevans@FreeBSD.org>
Wed, 8 May 2019 02:32:11 +0000 (02:32 +0000)
committerkevans <kevans@FreeBSD.org>
Wed, 8 May 2019 02:32:11 +0000 (02:32 +0000)
commit0f415eea65ecbddff79f47e67d6bd3bf6346fc6b
tree7fcc1f3d18e672a7f4f3c9a42fb34e649de6abf5
parent16793845b520ce91cd81ab1ab290214f7afbd9f4
tun/tap: merge and rename to `tuntap`

tun(4) and tap(4) share the same general management interface and have a lot
in common. Bugs exist in tap(4) that have been fixed in tun(4), and
vice-versa. Let's reduce the maintenance requirements by merging them
together and using flags to differentiate between the three interface types
(tun, tap, vmnet).

This fixes a couple of tap(4)/vmnet(4) issues right out of the gate:
- tap devices may no longer be destroyed while they're open [0]
- VIMAGE issues already addressed in tun by kp

[0] emaste had removed an easy-panic-button in r240938 due to devdrn
blocking. A naive glance over this leads me to believe that this isn't quite
complete -- destroy_devl will only block while executing d_* functions, but
doesn't block the device from being destroyed while a process has it open.
The latter is the intent of the condvar in tun, so this is "fixed" (for
certain definitions of the word -- it wasn't really broken in tap, it just
wasn't quite ideal).

ifconfig(8) also grew the ability to map an interface name to a kld, so
that `ifconfig {tun,tap}0` can continue to autoload the correct module, and
`ifconfig vmnet0 create` will now autoload the correct module. This is a
low overhead addition.

(MFC commentary)

This may get MFC'd if many bugs in tun(4)/tap(4) are discovered after this,
and how critical they are. Changes after this are likely easily MFC'd
without taking this merge, but the merge will be easier.

I have no plans to do this MFC as of now.

Reviewed by: bcr (manpages), tuexen (testing, syzkaller/packetdrill)
Input also from: melifaro
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D20044
35 files changed:
UPDATING
sbin/ifconfig/ifconfig.c
share/man/man4/tap.4
share/man/man4/tun.4
sys/amd64/conf/GENERIC
sys/amd64/conf/MINIMAL
sys/arm/conf/DOCKSTAR
sys/arm/conf/DREAMPLUG-1001
sys/arm/conf/EFIKA_MX
sys/arm/conf/IMX53
sys/arm/conf/IMX6
sys/arm/conf/TEGRA124
sys/arm64/conf/GENERIC
sys/conf/NOTES
sys/conf/files
sys/i386/conf/GENERIC
sys/i386/conf/MINIMAL
sys/mips/conf/ERL
sys/mips/conf/OCTEON1
sys/modules/Makefile
sys/modules/if_tap/Makefile [deleted file]
sys/modules/if_tun/Makefile [deleted file]
sys/modules/if_tuntap/Makefile [new file with mode: 0644]
sys/net/if_tap.c [deleted file]
sys/net/if_tap.h
sys/net/if_tapvar.h [deleted file]
sys/net/if_tun.c [deleted file]
sys/net/if_tuntap.c [new file with mode: 0644]
sys/powerpc/conf/GENERIC
sys/powerpc/conf/GENERIC64
sys/powerpc/conf/MPC85XX
sys/powerpc/conf/MPC85XXSPE
sys/powerpc/conf/QORIQ64
sys/riscv/conf/GENERIC
sys/sparc64/conf/GENERIC