wgengine/magicsock: only set addrByKey once in CreateEndpoint.

Signed-Off-By: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2020-03-05 18:12:45 -08:00 committed by Dave Anderson
parent fbab12c94c
commit 97e58ad44d

View File

@ -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