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
|
filt := c.filt
|
||||||
self := c.self
|
self := c.self
|
||||||
peers := c.peers
|
peers := c.peers
|
||||||
|
isClosed := c.closed
|
||||||
c.mu.Unlock() // release c.mu before potentially calling c.updateRelayServersSet which is O(m * n)
|
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 peersChanged || relayClientChanged {
|
||||||
if !relayClientEnabled {
|
if !relayClientEnabled {
|
||||||
c.relayManager.handleRelayServersSet(nil)
|
c.relayManager.handleRelayServersSet(nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user