Remove extraneous error checking

No reason to run TUNGIFHEAD, there's no fail condition in TUNSIFHEAD.
netbsd-dev-clean
snow flurry 9 months ago
parent 515908773f
commit 3a7f41792c
  1. 12
      tun/tun_netbsd.go

@ -145,18 +145,6 @@ func CreateTUN(name string, mtu int) (Device, error) {
return nil, fmt.Errorf("Unable to put into multi-af mode: %v", errno)
}
_, _, errno = unix.Syscall(
unix.SYS_IOCTL,
tunfile.Fd(),
uintptr(_TUNGIFHEAD),
uintptr(unsafe.Pointer(&ifheadmode)),
)
if errno != 0 || ifheadmode == 0 {
tunfile.Close()
return nil, fmt.Errorf("Unable to validate multi-af mode: %v", errno)
}
if err == nil && name == "tun" {
fname := os.Getenv("WG_TUN_NAME_FILE")
if fname != "" {

Loading…
Cancel
Save