aboutsummaryrefslogtreecommitdiffstats
path: root/src/tun.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-08-22 17:22:45 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-08-22 17:22:45 +0200
commit4986cfe78b49173b8a9d86b9ec7e3024d0a3c218 (patch)
tree73444bb682a9ada96f5ea666551141a933cad174 /src/tun.go
parentUpdate MTU based on netlink messages (linux) (diff)
downloadwireguard-go-4986cfe78b49173b8a9d86b9ec7e3024d0a3c218.tar.xz
wireguard-go-4986cfe78b49173b8a9d86b9ec7e3024d0a3c218.zip
Add support for fwmark on linux
Diffstat (limited to 'src/tun.go')
-rw-r--r--src/tun.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tun.go b/src/tun.go
index b4fbc62..8e8c759 100644
--- a/src/tun.go
+++ b/src/tun.go
@@ -34,28 +34,28 @@ func (device *Device) RoutineTUNEventReader() {
if err != nil {
logError.Println("Failed to load updated MTU of device:", err)
} else if int(old) != mtu {
- atomic.StoreInt32(&device.tun.mtu, int32(mtu))
if mtu+MessageTransportSize > MaxMessageSize {
logInfo.Println("MTU updated:", mtu, "(too large)")
} else {
logInfo.Println("MTU updated:", mtu)
}
+ atomic.StoreInt32(&device.tun.mtu, int32(mtu))
}
}
if event&TUNEventUp != 0 {
if !device.tun.isUp.Get() {
+ logInfo.Println("Interface set up")
device.tun.isUp.Set(true)
updateUDPConn(device)
- logInfo.Println("Interface set up")
}
}
if event&TUNEventDown != 0 {
if device.tun.isUp.Get() {
+ logInfo.Println("Interface set down")
device.tun.isUp.Set(false)
closeUDPConn(device)
- logInfo.Println("Interface set down")
}
}
}