aboutsummaryrefslogtreecommitdiffstats
path: root/src/tun_linux.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-17 14:36:08 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-17 14:36:08 +0100
commite1227d3af480eae72639cde842b4d538c58936dc (patch)
tree0263f8f1ecee9da28a0d5e951ad520972d8db504 /src/tun_linux.go
parentMoved TUN device creation to pre-fork (diff)
downloadwireguard-go-e1227d3af480eae72639cde842b4d538c58936dc.tar.xz
wireguard-go-e1227d3af480eae72639cde842b4d538c58936dc.zip
Allows passing UAPI fd to service
Diffstat (limited to 'src/tun_linux.go')
-rw-r--r--src/tun_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tun_linux.go b/src/tun_linux.go
index ce6304c..2a5b276 100644
--- a/src/tun_linux.go
+++ b/src/tun_linux.go
@@ -227,7 +227,7 @@ func (tun *NativeTun) MTU() (int, error) {
val := binary.LittleEndian.Uint32(ifr[16:20])
if val >= (1 << 31) {
- return int(val-(1<<31)) - (1 << 31), nil
+ return int(toInt32(val)), nil
}
return int(val), nil
}