mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
wgengine/magicsock: fix crash introduced in recent cleanups
Fixes #2801 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
640134421e
commit
2238814b99
@ -189,9 +189,14 @@ func (m *peerMap) deleteDiscoEndpoint(ep *endpoint) {
|
||||
return
|
||||
}
|
||||
ep.stopAndReset()
|
||||
pi := m.byDiscoKey[ep.discoKey]
|
||||
pi := m.byNodeKey[ep.publicKey]
|
||||
delete(m.byDiscoKey, ep.discoKey)
|
||||
delete(m.byNodeKey, ep.publicKey)
|
||||
if pi == nil {
|
||||
// Kneejerk paranoia from earlier issue 2801.
|
||||
// Unexpected. But no logger plumbed here to log so.
|
||||
return
|
||||
}
|
||||
for ip := range pi.ipPorts {
|
||||
delete(m.byIPPort, ip)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user