mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-07-29 13:44:30 +00:00
fix: resolve_preference should only assign each ip once 2
This commit is contained in:
@@ -39,9 +39,10 @@ func resolveIPAddrWithPreference(host string, pref ResolvePreference) (*net.IPAd
|
||||
var ip4, ip6 *net.IPAddr
|
||||
for i := range ips {
|
||||
ip := &ips[i]
|
||||
if ip4 == nil && ip.IP.To4() != nil {
|
||||
is4 := ip.IP.To4() != nil
|
||||
if ip4 == nil && is4 {
|
||||
ip4 = ip
|
||||
} else if ip6 == nil && ip.IP.To4() == nil {
|
||||
} else if ip6 == nil && !is4 {
|
||||
ip6 = ip
|
||||
}
|
||||
if ip4 != nil && ip6 != nil {
|
||||
|
Reference in New Issue
Block a user