Remove extraneous error checking
No reason to run TUNGIFHEAD, there's no fail condition in TUNSIFHEAD.
This commit is contained in:
parent
515908773f
commit
3a7f41792c
|
@ -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…
Reference in a new issue