fix AutoIptables

This commit is contained in:
maze.y2b@gmail.com
2021-12-04 19:59:41 +08:00
parent 8580ee8898
commit eb999b3bf1
5 changed files with 29 additions and 34 deletions

View File

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