From 3bace079488070a1fa5454d2f3b9aadd310101f4 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 21 Jan 2023 22:31:07 +0800 Subject: [PATCH] fix: ipv6 logic --- hub/executor/executor.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hub/executor/executor.go b/hub/executor/executor.go index 94398db1..16a194c2 100644 --- a/hub/executor/executor.go +++ b/hub/executor/executor.go @@ -154,20 +154,17 @@ func preUpdateExperimental(c *config.Config) { func updateDNS(c *config.DNS, generalIPv6 bool) { if !c.Enable { - resolver.DisableIPv6 = !generalIPv6 resolver.DefaultResolver = nil resolver.DefaultHostMapper = nil resolver.DefaultLocalServer = nil dns.ReCreateServer("", nil, nil) return - } else { - resolver.DisableIPv6 = !c.IPv6 } cfg := dns.Config{ Main: c.NameServer, Fallback: c.Fallback, - IPv6: c.IPv6, + IPv6: c.IPv6 && generalIPv6, EnhancedMode: c.EnhancedMode, Pool: c.FakeIPRange, Hosts: c.Hosts, @@ -312,9 +309,8 @@ func updateGeneral(general *config.General, force bool) { dialer.DisableIPv6 = !general.IPv6 if !dialer.DisableIPv6 { log.Infoln("Use IPv6") - } else { - resolver.DisableIPv6 = true } + resolver.DisableIPv6 = dialer.DisableIPv6 if general.TCPConcurrent { dialer.SetDial(general.TCPConcurrent)