mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-16 09:19:51 +00:00
fix: resolve_preference not work
This commit is contained in:
parent
1b2eb49da1
commit
4747be198e
@ -37,11 +37,15 @@ func resolveIPAddrWithPreference(host string, pref ResolvePreference) (*net.IPAd
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var ip4, ip6 *net.IPAddr
|
var ip4, ip6 *net.IPAddr
|
||||||
for _, ip := range ips {
|
for i := range ips {
|
||||||
|
ip := &ips[i]
|
||||||
if ip.IP.To4() != nil {
|
if ip.IP.To4() != nil {
|
||||||
ip4 = &ip
|
ip4 = ip
|
||||||
} else {
|
} else {
|
||||||
ip6 = &ip
|
ip6 = ip
|
||||||
|
}
|
||||||
|
if ip4 != nil && ip6 != nil {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch pref {
|
switch pref {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user