aboutsummaryrefslogtreecommitdiffstats
path: root/src/tun.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-01-13 09:00:37 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-01-13 09:00:37 +0100
commit1dd590b91b893a413666b6daaed848d89bab7f05 (patch)
tree702ff9185afe072565a17fb089cf6014f4cbccfc /src/tun.go
parentPeer timer teardown (diff)
downloadwireguard-go-1dd590b91b893a413666b6daaed848d89bab7f05.tar.xz
wireguard-go-1dd590b91b893a413666b6daaed848d89bab7f05.zip
Work on timer teardown + bug fixes
Added waitgroups to peer struct for routine start / stop synchronisation
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 024f0f0..6259f33 100644
--- a/src/tun.go
+++ b/src/tun.go
@@ -45,14 +45,14 @@ func (device *Device) RoutineTUNEventReader() {
}
}
- if event&TUNEventUp != 0 {
+ if event&TUNEventUp != 0 && !device.isUp.Get() {
logInfo.Println("Interface set up")
device.Up()
}
- if event&TUNEventDown != 0 {
+ if event&TUNEventDown != 0 && device.isUp.Get() {
logInfo.Println("Interface set down")
- device.Up()
+ device.Down()
}
}
}