This commit is contained in:
Clash-Mini
2022-02-06 01:59:35 +08:00
parent 28a1475f66
commit 4a446c4e31
6 changed files with 56 additions and 21 deletions

View File

@ -314,8 +314,7 @@ func patchSelectGroup(proxies map[string]C.Proxy) {
}
func updateIPTables(dns *config.DNS, general *config.General, tun *config.Tun) {
AutoIptables := C.AutoIptables
if runtime.GOOS != "linux" || dns.Listen == "" || general.TProxyPort == 0 || tun.Enable || AutoIptables != "Enable" {
if runtime.GOOS != "linux" || dns.Listen == "" || general.TProxyPort == 0 || tun.Enable || !general.AutoIptables {
return
}
@ -342,8 +341,7 @@ func updateIPTables(dns *config.DNS, general *config.General, tun *config.Tun) {
func CleanUp() {
P.CleanUp()
AutoIptables := C.AutoIptables
if runtime.GOOS == "linux" && AutoIptables == "Enable" {
if runtime.GOOS == "linux" {
tproxy.CleanUpTProxyLinuxIPTables()
}
}