aboutsummaryrefslogtreecommitdiffstats
path: root/src/tun.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-12-29 17:42:09 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-12-29 17:42:09 +0100
commitd73f960aab86b9a12b0b7d18aa80ce1d4f130695 (patch)
treeec4b6683c1c0b6b28a95b4bdb718dcc3faa0f222 /src/tun.go
parentRemoved IFF_NO_PI from TUN linux (diff)
downloadwireguard-go-d73f960aab86b9a12b0b7d18aa80ce1d4f130695.tar.xz
wireguard-go-d73f960aab86b9a12b0b7d18aa80ce1d4f130695.zip
Peer timer teardown
Diffstat (limited to 'src/tun.go')
-rw-r--r--src/tun.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tun.go b/src/tun.go
index 54253b4..024f0f0 100644
--- a/src/tun.go
+++ b/src/tun.go
@@ -46,21 +46,13 @@ func (device *Device) RoutineTUNEventReader() {
}
if event&TUNEventUp != 0 {
- if !device.tun.isUp.Get() {
- // begin listening for incomming datagrams
- logInfo.Println("Interface set up")
- device.tun.isUp.Set(true)
- updateBind(device)
- }
+ logInfo.Println("Interface set up")
+ device.Up()
}
if event&TUNEventDown != 0 {
- if device.tun.isUp.Get() {
- // stop listening for incomming datagrams
- logInfo.Println("Interface set down")
- device.tun.isUp.Set(false)
- closeBind(device)
- }
+ logInfo.Println("Interface set down")
+ device.Up()
}
}
}