diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-18 20:09:04 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-04-18 20:09:04 -0600 |
commit | b0e5b19969af3cdeec6894b09fa193b67455c6ec (patch) | |
tree | ba5cde8505a4a5be6b6549beb5c31b6b562c17af | |
parent | 39888214425f5c4d6c3c8344cc0087880de9e663 (diff) |
tun: freebsd: set IFF_MULTICAST for routing daemons
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | tun/tun_freebsd.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tun/tun_freebsd.go b/tun/tun_freebsd.go index c2ad65f..53d1584 100644 --- a/tun/tun_freebsd.go +++ b/tun/tun_freebsd.go @@ -143,9 +143,9 @@ func (tun *NativeTun) routineRouteListener(tunIfindex int) { } func tunName(fd uintptr) (string, error) { - //Terrible hack to make up for freebsd not having a TUNGIFNAME + // Terrible hack to make up for freebsd not having a TUNGIFNAME - //First, make sure the tun pid matches this proc's pid + // First, make sure the tun pid matches this proc's pid _, _, errno := unix.Syscall( unix.SYS_IOCTL, uintptr(fd), @@ -173,7 +173,7 @@ func tunName(fd uintptr) (string, error) { procPid := os.Getpid() - //Try to find interface with matching PID + // Try to find interface with matching PID for i := 1; ; i++ { iface, _ := net.InterfaceByIndex(i) if err != nil || iface == nil { @@ -293,7 +293,7 @@ func CreateTUN(name string, mtu int) (Device, error) { } // Get out of PPP mode. - ifflags := syscall.IFF_BROADCAST + ifflags := syscall.IFF_BROADCAST | syscall.IFF_MULTICAST tun.operateOnFd(func(fd uintptr) { _, _, errno = unix.Syscall( unix.SYS_IOCTL, |