fix: ipv6 enable logic

This commit is contained in:
adlyq 2022-04-23 01:31:34 +08:00
parent 0a99fc4d74
commit bd3c493c9f
2 changed files with 4 additions and 3 deletions

View file

@ -94,6 +94,7 @@ func (pp *proxySetProvider) setProxies(proxies []C.Proxy) {
if pp.healthCheck.auto() { if pp.healthCheck.auto() {
go pp.healthCheck.check() go pp.healthCheck.check()
} }
} }
func stopProxyProvider(pd *ProxySetProvider) { func stopProxyProvider(pd *ProxySetProvider) {

View file

@ -139,7 +139,7 @@ func updateDNS(c *config.DNS, t *config.Tun) {
ProxyServer: c.ProxyServerNameserver, ProxyServer: c.ProxyServerNameserver,
} }
resolver.DisableIPv6 = cfg.IPv6 resolver.DisableIPv6 = !cfg.IPv6
r := dns.NewResolver(cfg) r := dns.NewResolver(cfg)
pr := dns.NewProxyServerHostResolver(r) pr := dns.NewProxyServerHostResolver(r)
@ -246,9 +246,9 @@ func updateSniffer(sniffer *config.Sniffer) {
func updateGeneral(general *config.General, force bool) { func updateGeneral(general *config.General, force bool) {
log.SetLevel(general.LogLevel) log.SetLevel(general.LogLevel)
tunnel.SetMode(general.Mode) tunnel.SetMode(general.Mode)
dialer.DisableIPv6 = general.IPv6 dialer.DisableIPv6 = !general.IPv6
if !dialer.DisableIPv6 { if !dialer.DisableIPv6 {
resolver.DisableIPv6 = dialer.DisableIPv6 resolver.DisableIPv6 = false
} else { } else {
log.Infoln("Use IPv6") log.Infoln("Use IPv6")
} }