diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 2136bdb1d..db329047a 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -4438,7 +4438,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.