Cleanup error handling

This commit is contained in:
snow flurry 2022-03-21 19:40:24 -07:00
parent 5181a06304
commit 470f2f0248

View file

@ -157,7 +157,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
if errno != 0 {
tunfile.Close()
return nil, fmt.Errorf("Unable to put into IFHEAD mode: %v", errno)
return nil, fmt.Errorf("Unable to put into multi-af mode: %v", errno)
}
_, _, errno = unix.Syscall(
@ -169,7 +169,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
if errno != 0 || ifheadmode == 0 {
tunfile.Close()
return nil, fmt.Errorf("Unable to validate IFHEAD mode: %v (ifheadmode = %d)", errno, ifheadmode)
return nil, fmt.Errorf("Unable to validate multi-af mode: %v", errno)
}
if err == nil && name == "tun" {