diff options
Diffstat (limited to 'tun_openbsd.go')
-rw-r--r-- | tun_openbsd.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tun_openbsd.go b/tun_openbsd.go index 97d8f38..932404e 100644 --- a/tun_openbsd.go +++ b/tun_openbsd.go @@ -356,11 +356,5 @@ func (tun *NativeTun) MTU() (int, error) { return 0, fmt.Errorf("failed to get MTU on %s", tun.name) } - // convert result to signed 32-bit int - mtu := ifr.MTU - if mtu >= (1 << 31) { - return int(mtu-(1<<31)) - (1 << 31), nil - } - return int(mtu), nil - + return int(*(*int32)(unsafe.Pointer(&ifr.MTU))), nil } |