diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-04-30 16:43:26 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-05-06 12:44:22 -0700 |
| commit | ddd85b9d91ebf3d7905f506afe46d50eee740fbb (patch) | |
| tree | 15fce8890326976a5c5827d1569ed1e4088237aa | |
| parent | e0bd3cc70cfb776ad9b4f0b418923662d7b9b050 (diff) | |
| download | tailscale-ddd85b9d91ebf3d7905f506afe46d50eee740fbb.tar.xz tailscale-ddd85b9d91ebf3d7905f506afe46d50eee740fbb.zip | |
wgengine/magicsock: rename discoEndpoint.wgEndpointHostPort to wgEndpoint
Fields rename only.
Part of the general effort to make our code agnostic about endpoint formatting.
It's just a name, but it will soon be a misleading one; be more generic.
Do this as a separate commit because it generates a lot of whitespace changes.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
| -rw-r--r-- | wgengine/magicsock/magicsock.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 18d60c2d8..2a88c1d64 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -2767,13 +2767,13 @@ func (c *Conn) ParseEndpoint(keyAddrs string) (conn.Endpoint, error) { return nil, fmt.Errorf("magicsock: invalid discokey endpoint %q for %v: %w", addrs, pk.ShortString(), err) } de := &discoEndpoint{ - c: c, - publicKey: tailcfg.NodeKey(pk), // peer public key (for WireGuard + DERP) - discoKey: tailcfg.DiscoKey(discoKey), // for discovery mesages - discoShort: tailcfg.DiscoKey(discoKey).ShortString(), - wgEndpointHostPort: addrs, - sentPing: map[stun.TxID]sentPing{}, - endpointState: map[netaddr.IPPort]*endpointState{}, + c: c, + publicKey: tailcfg.NodeKey(pk), // peer public key (for WireGuard + DERP) + discoKey: tailcfg.DiscoKey(discoKey), // for discovery mesages + discoShort: tailcfg.DiscoKey(discoKey).ShortString(), + wgEndpoint: addrs, + sentPing: map[stun.TxID]sentPing{}, + endpointState: map[netaddr.IPPort]*endpointState{}, } de.initFakeUDPAddr() de.updateFromNode(c.nodeOfDisco[de.discoKey]) @@ -3110,12 +3110,12 @@ type discoEndpoint struct { numStopAndResetAtomic int64 // These fields are initialized once and never modified. - c *Conn - publicKey tailcfg.NodeKey // peer public key (for WireGuard + DERP) - discoKey tailcfg.DiscoKey // for discovery mesages - discoShort string // ShortString of discoKey - fakeWGAddr netaddr.IPPort // the UDP address we tell wireguard-go we're using - wgEndpointHostPort string // string from ParseEndpoint: "<hex-discovery-key>.disco.tailscale:12345" + c *Conn + publicKey tailcfg.NodeKey // peer public key (for WireGuard + DERP) + discoKey tailcfg.DiscoKey // for discovery mesages + discoShort string // ShortString of discoKey + fakeWGAddr netaddr.IPPort // the UDP address we tell wireguard-go we're using + wgEndpoint string // string from ParseEndpoint: "<hex-discovery-key>.disco.tailscale:12345" // Owned by Conn.mu: lastPingFrom netaddr.IPPort @@ -3295,7 +3295,7 @@ func (de *discoEndpoint) String() string { func (de *discoEndpoint) ClearSrc() {} func (de *discoEndpoint) SrcToString() string { panic("unused") } // unused by wireguard-go func (de *discoEndpoint) SrcIP() net.IP { panic("unused") } // unused by wireguard-go -func (de *discoEndpoint) DstToString() string { return de.wgEndpointHostPort } +func (de *discoEndpoint) DstToString() string { return de.wgEndpoint } func (de *discoEndpoint) DstIP() net.IP { panic("unused") } func (de *discoEndpoint) DstToBytes() []byte { return packIPPort(de.fakeWGAddr) } |
