wgengine/magicsock: fix relayManager deadlock (#17449)

Updates tailscale/corp#32978

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2025-10-04 20:27:57 -07:00
committed by GitHub
parent 3aa8b6d683
commit e44e28efcd
2 changed files with 43 additions and 1 deletions
+4 -1
View File
@@ -758,7 +758,10 @@ func (r *relayManager) handleNewServerEndpointRunLoop(newServerEndpoint newRelay
ctx: ctx,
cancel: cancel,
}
if byServerDisco == nil {
// We must look up byServerDisco again. The previous value may have been
// deleted from the outer map when cleaning up duplicate work.
byServerDisco, ok = r.handshakeWorkByServerDiscoByEndpoint[newServerEndpoint.wlb.ep]
if !ok {
byServerDisco = make(map[key.DiscoPublic]*relayHandshakeWork)
r.handshakeWorkByServerDiscoByEndpoint[newServerEndpoint.wlb.ep] = byServerDisco
}