Remove extraneous error checking

No reason to run TUNGIFHEAD, there's no fail condition in TUNSIFHEAD.
This commit is contained in:
snow flurry 2022-03-21 20:00:27 -07:00
parent 515908773f
commit 3a7f41792c
1 changed files with 0 additions and 12 deletions

View File

@ -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) 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" { if err == nil && name == "tun" {
fname := os.Getenv("WG_TUN_NAME_FILE") fname := os.Getenv("WG_TUN_NAME_FILE")
if fname != "" { if fname != "" {