1 From e7839b5e9de01f8dca66449eb2e720963a56f403 Mon Sep 17 00:00:00 2001
2 From: mzz2017 <mzz@tuta.io>
3 Date: Sat, 5 Feb 2022 20:23:32 +0800
4 Subject: [PATCH] fix: failed to clean iptables rules in some cases
7 service/core/v2ray/transparent.go | 13 ++++++-------
8 1 file changed, 6 insertions(+), 7 deletions(-)
10 diff --git a/core/v2ray/transparent.go b/core/v2ray/transparent.go
11 index 5480660..07b01a0 100644
12 --- a/core/v2ray/transparent.go
13 +++ b/core/v2ray/transparent.go
14 @@ -12,12 +12,14 @@ import (
17 func DeleteTransparentProxyRules() {
18 - removeResolvHijacker()
19 iptables.CloseWatcher()
20 - iptables.Tproxy.GetCleanCommands().Run(false)
21 - iptables.Redirect.GetCleanCommands().Run(false)
22 + if !conf.GetEnvironmentConfig().Lite {
23 + removeResolvHijacker()
24 + iptables.Tproxy.GetCleanCommands().Run(false)
25 + iptables.Redirect.GetCleanCommands().Run(false)
26 + iptables.DropSpoofing.GetCleanCommands().Run(false)
28 iptables.SystemProxy.GetCleanCommands().Run(false)
29 - iptables.DropSpoofing.GetCleanCommands().Run(false)
30 time.Sleep(100 * time.Millisecond)
33 @@ -89,9 +91,6 @@ func CheckAndSetupTransparentProxy(checkRunning bool, setting *configure.Setting
36 func CheckAndStopTransparentProxy() {
37 - if !IsTransparentOn() {
40 DeleteTransparentProxyRules()