device: remove device.state.stopping from RoutineTUNEventReader
The TUN event reader does three things: Change MTU, device up, and device down. Changing the MTU after the device is closed does no harm. Device up and device down don't make sense after the device is closed, but we can check that condition before proceeding with changeState. There's thus no reason to block device.Close on RoutineTUNEventReader exiting. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
0bcb822e5b
commit
3516ccc1e2
|
@ -383,7 +383,7 @@ func NewDevice(tunDevice tun.Device, logger *Logger) *Device {
|
||||||
go device.RoutineHandshake()
|
go device.RoutineHandshake()
|
||||||
}
|
}
|
||||||
|
|
||||||
device.state.stopping.Add(2)
|
device.state.stopping.Add(1) // read from TUN
|
||||||
go device.RoutineReadFromTUN()
|
go device.RoutineReadFromTUN()
|
||||||
go device.RoutineTUNEventReader()
|
go device.RoutineTUNEventReader()
|
||||||
|
|
||||||
|
|
|
@ -47,5 +47,4 @@ func (device *Device) RoutineTUNEventReader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
device.log.Verbosef("Routine: event worker - stopped")
|
device.log.Verbosef("Routine: event worker - stopped")
|
||||||
device.state.stopping.Done()
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue