aboutsummaryrefslogtreecommitdiffstats
path: root/tun.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 22:20:15 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 22:20:15 +0200
commit846d721dfd0cde953f2e9304d6ef50110de050eb (patch)
tree8de15914ab39d0aad1b50d03530b82fece54c740 /tun.go
parentFix dir permissions (diff)
downloadwireguard-go-846d721dfd0cde953f2e9304d6ef50110de050eb.tar.xz
wireguard-go-846d721dfd0cde953f2e9304d6ef50110de050eb.zip
Finer-grained start-stop synchronization
Diffstat (limited to 'tun.go')
-rw-r--r--tun.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tun.go b/tun.go
index ec3ab47..ef80625 100644
--- a/tun.go
+++ b/tun.go
@@ -35,6 +35,8 @@ func (device *Device) RoutineTUNEventReader() {
logInfo := device.log.Info
logError := device.log.Error
+ device.state.starting.Done()
+
for event := range device.tun.device.Events() {
if event&TUNEventMTUUpdate != 0 {
mtu, err := device.tun.device.MTU()
@@ -63,4 +65,6 @@ func (device *Device) RoutineTUNEventReader() {
device.Down()
}
}
+
+ device.state.stopping.Done()
}