mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-24 17:47:30 +00:00
wgengine/magicsock: do not apply node view updates to a closed Conn (#17517)
Fixes #17516 Change-Id: Iae2dab42d6f7bc618478d360a1005537c1fa1bbd Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
@@ -2958,8 +2958,13 @@ func (c *Conn) onNodeViewsUpdate(update NodeViewsUpdate) {
|
||||
filt := c.filt
|
||||
self := c.self
|
||||
peers := c.peers
|
||||
isClosed := c.closed
|
||||
c.mu.Unlock() // release c.mu before potentially calling c.updateRelayServersSet which is O(m * n)
|
||||
|
||||
if isClosed {
|
||||
return // nothing to do here, the conn is closed and the update is no longer relevant
|
||||
}
|
||||
|
||||
if peersChanged || relayClientChanged {
|
||||
if !relayClientEnabled {
|
||||
c.relayManager.handleRelayServersSet(nil)
|
||||
|
||||
Reference in New Issue
Block a user