fix: ipv6 enable logic

This commit is contained in:
gVisor bot 2022-04-23 01:31:34 +08:00
parent 7e61c9b6b3
commit fbcf9b6801
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() {
go pp.healthCheck.check()
}
}
func stopProxyProvider(pd *ProxySetProvider) {

View File

@ -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")
}