mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-15 10:49:18 +00:00
tailcfg, net/netcheck: let control mark "Avoid" bit on DERP regions
So a region can be used if needed, but won't be STUN-probed or used as its home. This gives us another possible debugging mechanism for #1310, or can be used as a short-term measure against DERP flip-flops for people equidistant between regions if our hysteresis still isn't good enough. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -305,6 +305,9 @@ type probePlan map[string][]probe
|
||||
func sortRegions(dm *tailcfg.DERPMap, last *Report) (prev []*tailcfg.DERPRegion) {
|
||||
prev = make([]*tailcfg.DERPRegion, 0, len(dm.Regions))
|
||||
for _, reg := range dm.Regions {
|
||||
if reg.Avoid {
|
||||
continue
|
||||
}
|
||||
prev = append(prev, reg)
|
||||
}
|
||||
sort.Slice(prev, func(i, j int) bool {
|
||||
|
Reference in New Issue
Block a user