Properly close DummyTUN to avoid deadlock in TestNoiseHandshake

License: MIT
Signed-off-by: Filippo Valsorda <valsorda@google.com>
This commit is contained in:
Filippo Valsorda
2018-05-20 23:12:55 -04:00
committed by Jason A. Donenfeld
parent 1c666576d5
commit 7bdc5eb54e
3 changed files with 12 additions and 1 deletions

3
tun.go
View File

@@ -33,9 +33,11 @@ type TUNDevice interface {
func (device *Device) RoutineTUNEventReader() {
setUp := false
logDebug := device.log.Debug
logInfo := device.log.Info
logError := device.log.Error
logDebug.Println("Routine: event worker - started")
device.state.starting.Done()
for event := range device.tun.device.Events() {
@@ -67,5 +69,6 @@ func (device *Device) RoutineTUNEventReader() {
}
}
logDebug.Println("Routine: event worker - stopped")
device.state.stopping.Done()
}