mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 10:01:57 +00:00
wgengine/magicsock: make peerMap also keyed by NodeID
In prep for incremental netmap update plumbing (#1909), make peerMap also keyed by NodeID, as all the netmap node mutations passed around later will be keyed by NodeID. In the process, also: * add envknob.InDevMode, as a signal that we can panic more aggressively in unexpected cases. * pull two moderately large blocks of code in Conn.SetNetworkMap out into their own methods * convert a few more sets from maps to set.Set Updates #1909 Change-Id: I7acdd64452ba58e9d554140ee7a8760f9043f961 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
683ba62f3e
commit
d050700a3b
@@ -49,6 +49,7 @@ type endpoint struct {
|
||||
|
||||
// These fields are initialized once and never modified.
|
||||
c *Conn
|
||||
nodeID tailcfg.NodeID
|
||||
publicKey key.NodePublic // peer public key (for WireGuard + DERP)
|
||||
publicKeyHex string // cached output of publicKey.UntypedHexString
|
||||
fakeWGAddr netip.AddrPort // the UDP address we tell wireguard-go we're using
|
||||
|
||||
Reference in New Issue
Block a user