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:
M. J. Fromberger
2025-10-09 23:58:03 -07:00
committed by GitHub
parent 16a05c7680
commit 154d36f73d

View File

@@ -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)