diff --git a/device/device.go b/device/device.go index c637e38..52b0143 100644 --- a/device/device.go +++ b/device/device.go @@ -383,7 +383,7 @@ func NewDevice(tunDevice tun.Device, logger *Logger) *Device { go device.RoutineHandshake() } - device.state.stopping.Add(2) + device.state.stopping.Add(1) // read from TUN go device.RoutineReadFromTUN() go device.RoutineTUNEventReader() diff --git a/device/tun.go b/device/tun.go index ca3c91b..9ff6c23 100644 --- a/device/tun.go +++ b/device/tun.go @@ -47,5 +47,4 @@ func (device *Device) RoutineTUNEventReader() { } device.log.Verbosef("Routine: event worker - stopped") - device.state.stopping.Done() }