mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
net/dnsfallback: do not attempt lookups of IPs.
Currently if the passed in host is an IP, Lookup still attempts to resolve it with a dns server. This makes it just return the IP directly. Updates tailscale/corp#4475 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
b45bb577a0
commit
b2f269d5b7
@ -27,6 +27,10 @@
|
||||
)
|
||||
|
||||
func Lookup(ctx context.Context, host string) ([]netaddr.IP, error) {
|
||||
if ip, err := netaddr.ParseIP(host); err == nil && !ip.IsZero() {
|
||||
return []netaddr.IP{ip}, nil
|
||||
}
|
||||
|
||||
type nameIP struct {
|
||||
dnsName string
|
||||
ip netaddr.IP
|
||||
|
Loading…
Reference in New Issue
Block a user