wgengine/netstack: include DNS.ExtraRecords in DNSMap

So SOCKS5 dialer can dial HTTPS cert names, for instance.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit 29a8fb45d32b562c7b0624a56170978076506a67)
This commit is contained in:
Brad Fitzpatrick 2021-09-28 10:01:05 -07:00
parent 22b881e82b
commit 7bb2fd5c76

View File

@ -206,6 +206,16 @@ func DNSMapFromNetworkMap(nm *netmap.NetworkMap) DNSMap {
break
}
}
for _, rec := range nm.DNS.ExtraRecords {
if rec.Type != "" {
continue
}
ip, err := netaddr.ParseIP(rec.Value)
if err != nil {
continue
}
ret[strings.TrimRight(rec.Name, ".")] = ip
}
return ret
}