mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
net/netcheck: respect DERPRegion.Avoid on initial probe plan too
As found by @jwhited/@raggi. Updates #8603 Updates #13969 Updates tailscale/corp#24697 Change-Id: I32bb412a06e46a5fc154d87147e75363cf0d5407 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
9f33aeb649
commit
c084e3f6ec
@ -541,7 +541,7 @@ func makeProbePlanInitial(dm *tailcfg.DERPMap, ifState *netmon.State) (plan prob
|
||||
plan = make(probePlan)
|
||||
|
||||
for _, reg := range dm.Regions {
|
||||
if len(reg.Nodes) == 0 {
|
||||
if reg.Avoid || len(reg.Nodes) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ func TestMakeProbePlan(t *testing.T) {
|
||||
basicMap := &tailcfg.DERPMap{
|
||||
Regions: map[int]*tailcfg.DERPRegion{},
|
||||
}
|
||||
for rid := 1; rid <= 5; rid++ {
|
||||
for rid := 1; rid <= 6; rid++ {
|
||||
var nodes []*tailcfg.DERPNode
|
||||
for nid := 0; nid < rid; nid++ {
|
||||
nodes = append(nodes, &tailcfg.DERPNode{
|
||||
@ -415,6 +415,7 @@ func TestMakeProbePlan(t *testing.T) {
|
||||
basicMap.Regions[rid] = &tailcfg.DERPRegion{
|
||||
RegionID: rid,
|
||||
Nodes: nodes,
|
||||
Avoid: rid == 6,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user