]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Disable broadcast mode on *BSD
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 27 May 2018 00:26:56 +0000 (02:26 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 27 May 2018 20:55:15 +0000 (22:55 +0200)
Keeping it on makes IPv6 problematic and confuses routing daemons.

tun/tun_freebsd.go
tun/tun_openbsd.go

index 435ff91be074c39debb70419f00ac9940d94642c..8c7bcdda9ba31c1b4877bc4a9bf9fb3d3da80c30 100644 (file)
@@ -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
index 3c1878b26ed2eca05e7f48885e738dfdb9ab18c9..5a341f6837d87f7d39c8f9ad24be6ad10973f685 100644 (file)
@@ -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" {