mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-04-15 13:36:55 +02:00
Disable broadcast mode on *BSD
Keeping it on makes IPv6 problematic and confuses routing daemons.
This commit is contained in:
parent
fc3a7635e5
commit
5079298ce2
2 changed files with 0 additions and 26 deletions
|
@ -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
|
||||
|
|
|
@ -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" {
|
||||
|
|
Loading…
Add table
Reference in a new issue