mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
net/dnsfallback: shuffle returned IPs
This ensures that we're trying multiple returned IPs, since the DERP servers return the same response to all queries. This should increase the chances that we eventually reach a working IP. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Ie8d4fb93df96da910fae49ae71bf3e402b9fdecc
This commit is contained in:
parent
ef6f66bb9a
commit
27575cd52d
@ -87,6 +87,7 @@ type nameIP struct {
|
||||
continue
|
||||
}
|
||||
if ips := dm[host]; len(ips) > 0 {
|
||||
rand.Shuffle(len(ips), func(i, j int) { ips[i], ips[j] = ips[j], ips[i] })
|
||||
logf("bootstrapDNS(%q, %q) for %q = %v", cand.dnsName, cand.ip, host, ips)
|
||||
return ips, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user