From 5079298ce2fb783ccfff83b4cf4af57c74ed2546 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 27 May 2018 02:26:56 +0200 Subject: [PATCH] Disable broadcast mode on *BSD Keeping it on makes IPv6 problematic and confuses routing daemons. --- tun/tun_freebsd.go | 13 ------------- tun/tun_openbsd.go | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/tun/tun_freebsd.go b/tun/tun_freebsd.go index 435ff91..8c7bcdd 100644 --- a/tun/tun_freebsd.go +++ b/tun/tun_freebsd.go @@ -262,19 +262,6 @@ func CreateTUN(name string, mtu int) (TUNDevice, error) { return nil, fmt.Errorf("error %s", errno.Error()) } - // Set TUN iface to broadcast mode. TUN inferfaces on freebsd come up in point to point by default - ifmodemode := unix.IFF_BROADCAST - _, _, errno = unix.Syscall( - unix.SYS_IOCTL, - uintptr(tunfd), - uintptr(_TUNSIFMODE), - uintptr(unsafe.Pointer(&ifmodemode)), - ) - - if errno != 0 { - return nil, fmt.Errorf("error %s", errno.Error()) - } - // Rename tun interface // Open control socket diff --git a/tun/tun_openbsd.go b/tun/tun_openbsd.go index 3c1878b..5a341f6 100644 --- a/tun/tun_openbsd.go +++ b/tun/tun_openbsd.go @@ -129,19 +129,6 @@ func CreateTUN(name string, mtu int) (TUNDevice, error) { return nil, err } - // Set TUN iface to broadcast mode - ifmodemode := unix.IFF_BROADCAST - _, _, errno := unix.Syscall( - unix.SYS_IOCTL, - uintptr(tunfile.Fd()), - uintptr(_TUNSIFMODE), - uintptr(unsafe.Pointer(&ifmodemode)), - ) - - if errno != 0 { - return nil, fmt.Errorf("error %s", errno.Error()) - } - tun, err := CreateTUNFromFile(tunfile, mtu) if err == nil && name == "tun" {