From 97e58ad44d4663293b3d16572d53f2505de44fce Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 5 Mar 2020 18:12:45 -0800 Subject: [PATCH] wgengine/magicsock: only set addrByKey once in CreateEndpoint. Signed-Off-By: David Anderson --- wgengine/magicsock/magicsock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 94df5ef60..b1a11110a 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -1258,8 +1258,8 @@ func (c *Conn) CreateEndpoint(key [32]byte, addrs string) (conn.Endpoint, error) copy(epAddr.ip.Addr[:], addr.IP.To16()) epAddr.port = uint16(addr.Port) c.addrsByUDP[epAddr] = a - c.addrsByKey[key] = a } + c.addrsByKey[key] = a c.addrsMu.Unlock() return a, nil