From bd3c493c9f54cd271c83ecfa83684a4ee6cfe191 Mon Sep 17 00:00:00 2001 From: adlyq <2833154405@qq.com> Date: Sat, 23 Apr 2022 01:31:34 +0800 Subject: [PATCH] fix: ipv6 enable logic --- adapter/provider/provider.go | 1 + hub/executor/executor.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adapter/provider/provider.go b/adapter/provider/provider.go index 2d449aed..e8dbe9fb 100644 --- a/adapter/provider/provider.go +++ b/adapter/provider/provider.go @@ -94,6 +94,7 @@ func (pp *proxySetProvider) setProxies(proxies []C.Proxy) { if pp.healthCheck.auto() { go pp.healthCheck.check() } + } func stopProxyProvider(pd *ProxySetProvider) { diff --git a/hub/executor/executor.go b/hub/executor/executor.go index 1e15c08e..a92aaee6 100644 --- a/hub/executor/executor.go +++ b/hub/executor/executor.go @@ -139,7 +139,7 @@ func updateDNS(c *config.DNS, t *config.Tun) { ProxyServer: c.ProxyServerNameserver, } - resolver.DisableIPv6 = cfg.IPv6 + resolver.DisableIPv6 = !cfg.IPv6 r := dns.NewResolver(cfg) pr := dns.NewProxyServerHostResolver(r) @@ -246,9 +246,9 @@ func updateSniffer(sniffer *config.Sniffer) { func updateGeneral(general *config.General, force bool) { log.SetLevel(general.LogLevel) tunnel.SetMode(general.Mode) - dialer.DisableIPv6 = general.IPv6 + dialer.DisableIPv6 = !general.IPv6 if !dialer.DisableIPv6 { - resolver.DisableIPv6 = dialer.DisableIPv6 + resolver.DisableIPv6 = false } else { log.Infoln("Use IPv6") }