From b78be1c8019a31fac2da00bb368ac0ea192c551f Mon Sep 17 00:00:00 2001 From: mzz2017 Date: Fri, 8 Jul 2022 22:08:01 +0800 Subject: [PATCH] fix(tproxy): RemoveIPWhitelist should apply to correct chain --- service/core/iptables/tproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/core/iptables/tproxy.go b/service/core/iptables/tproxy.go index 206bc220..43e72b25 100644 --- a/service/core/iptables/tproxy.go +++ b/service/core/iptables/tproxy.go @@ -32,7 +32,7 @@ func (t *tproxy) AddIPWhitelist(cidr string) { func (t *tproxy) RemoveIPWhitelist(cidr string) { var commands string - commands = fmt.Sprintf(`iptables -w 2 -t mangle -D SETMARK -d %s -j RETURN`, cidr) + commands = fmt.Sprintf(`iptables -w 2 -t mangle -D TP_RULE -d %s -j RETURN`, cidr) if !strings.Contains(cidr, ".") { //ipv6 commands = strings.Replace(commands, "iptables", "ip6tables", 1)