wgengine/magicsock: ensure that an existing timer is stopped
There presently is not a bug here, but this is a time-bomb waiting for an innocent incremental change to accidentally adjust the parent call chain resulting in a timer leak. Updates #cleanup Signed-off-by: James Tucker <james@tailscale.com>raggi/heartbeat-timebomb
parent
c783f28228
commit
0fd6bf0a1c
|
@ -4441,7 +4441,10 @@ func (de *endpoint) heartbeat() {
|
|||
de.mu.Lock()
|
||||
defer de.mu.Unlock()
|
||||
|
||||
de.heartBeatTimer = nil
|
||||
if de.heartBeatTimer != nil {
|
||||
de.heartBeatTimer.Stop()
|
||||
de.heartBeatTimer = nil
|
||||
}
|
||||
|
||||
if de.heartbeatDisabled {
|
||||
// If control override to disable heartBeatTimer set, return early.
|
||||
|
|
Loading…
Reference in New Issue