fix: resolve ip of udp proxy error

This commit is contained in:
gVisor bot 2022-08-29 13:04:48 +08:00
parent c7c80cf90e
commit 843e1c0f27

View File

@ -104,7 +104,7 @@ func resolveUDPAddrWithPrefer(network, address string, prefer C.DNSPrefer) (*net
ip = fallback
}
default:
// C.IPv4Prefer, C.DualStack and other
// C.IPv4Prefer, C.DualStack and other
var ips []netip.Addr
ips, err = resolver.ResolveAllIPProxyServerHost(host)
var fallback netip.Addr
@ -119,7 +119,10 @@ func resolveUDPAddrWithPrefer(network, address string, prefer C.DNSPrefer) (*net
}
}
}
ip = fallback
if !ip.IsValid() && fallback.IsValid() {
ip = fallback
}
}
}