net/dns/publicdns: add missing call to sync.Once.Do (#4410)

Signed-off-by: Jenny Zhang <jz@tailscale.com>
pull/4234/merge
phirework 2 years ago committed by GitHub
parent 83c734a6e0
commit 52d32c94d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,6 +33,7 @@ func DoHIPsOfBase() map[string][]netaddr.IP {
// DoHV6 returns the first IPv6 DNS address from a given public DNS provider
// if found, along with a boolean indicating success.
func DoHV6(base string) (ip netaddr.IP, ok bool) {
populateOnce.Do(populate)
for _, ip := range dohIPsOfBase[base] {
if ip.Is6() {
return ip, true

Loading…
Cancel
Save