mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-29 20:42:22 +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 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Lookup(ctx context.Context, host string) ([]netaddr.IP, error) {
|
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 {
|
type nameIP struct {
|
||||||
dnsName string
|
dnsName string
|
||||||
ip netaddr.IP
|
ip netaddr.IP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user