mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-12 15:29:57 +00:00
fix: resolve_preference should only assign each ip once
This commit is contained in:
parent
1462cadfdc
commit
88099ee72d
@ -39,9 +39,9 @@ func resolveIPAddrWithPreference(host string, pref ResolvePreference) (*net.IPAd
|
||||
var ip4, ip6 *net.IPAddr
|
||||
for i := range ips {
|
||||
ip := &ips[i]
|
||||
if ip.IP.To4() != nil {
|
||||
if ip4 == nil && ip.IP.To4() != nil {
|
||||
ip4 = ip
|
||||
} else {
|
||||
} else if ip6 == nil && ip.IP.To4() == nil {
|
||||
ip6 = ip
|
||||
}
|
||||
if ip4 != nil && ip6 != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user