From 093ae70293e341c5045c3ff3f0839d96efb8c1d1 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 15 Oct 2021 16:57:59 -0700 Subject: [PATCH] wgengine/magicsock: remove redundant/wrong sharedDiscoKey delete The pass just after in this method handles cleaning up sharedDiscoKey. No need to do it wrong (assuming DiscoKey => 1 node) earlier. Updates #3088 Signed-off-by: Brad Fitzpatrick (cherry picked from commit 36a07089ee6a49a7a178db486c9716de1e77201a) --- wgengine/magicsock/magicsock.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index ac9ad5d6e..0dcd3280a 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -2179,9 +2179,6 @@ func (c *Conn) SetNetworkMap(nm *netmap.NetworkMap) { c.peerMap.forEachDiscoEndpoint(func(ep *endpoint) { if !keep[ep.publicKey] { c.peerMap.deleteDiscoEndpoint(ep) - if !ep.discoKey.IsZero() { - delete(c.sharedDiscoKey, ep.discoKey) - } } }) }