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

This commit is contained in:
Brad Fitzpatrick 2020-02-21 14:47:05 -08:00
parent 3317531021
commit cc7b9b0dff
2 changed files with 2 additions and 2 deletions

View File

@ -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")
for i := range nm.Peers {
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 {

View File

@ -758,7 +758,7 @@ func (c *Conn) LinkChange() {
// AddrSet is a set of UDP addresses that implements wireguard/device.Endpoint.
type AddrSet struct {
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