control/controlclient: fix priority of DERP server, add comment

pull/94/head
Brad Fitzpatrick 4 years ago
parent 3317531021
commit cc7b9b0dff

@ -544,7 +544,7 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM
c.logf("debug: adding DERP endpoints to all peers") c.logf("debug: adding DERP endpoints to all peers")
for i := range nm.Peers { for i := range nm.Peers {
peer := &nm.Peers[i] peer := &nm.Peers[i]
peer.Endpoints = append(peer.Endpoints, "127.3.3.40:1") peer.Endpoints = append([]string{"127.3.3.40:1"}, peer.Endpoints...)
} }
} }
for _, profile := range resp.UserProfiles { for _, profile := range resp.UserProfiles {

@ -758,7 +758,7 @@ func (c *Conn) LinkChange() {
// AddrSet is a set of UDP addresses that implements wireguard/device.Endpoint. // AddrSet is a set of UDP addresses that implements wireguard/device.Endpoint.
type AddrSet struct { type AddrSet struct {
publicKey key.Public // peer public key used for DERP communication publicKey key.Public // peer public key used for DERP communication
addrs []net.UDPAddr // ordered priority list provided by wgengine addrs []net.UDPAddr // ordered priority list (low to high) provided by wgengine
mu sync.Mutex // guards roamAddr and curAddr mu sync.Mutex // guards roamAddr and curAddr

Loading…
Cancel
Save