From: qydysky Date: Sat, 13 Apr 2024 08:37:41 +0000 (+0000) Subject: 1 X-Git-Tag: v0.28.20240413084255 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=4d106b36b3fba08c5efc3c3d06c7838f0b536c3a;p=part%2F.git 1 --- diff --git a/Net.go b/Net.go index 8c89074..8815459 100644 --- a/Net.go +++ b/Net.go @@ -209,11 +209,11 @@ func Forward(targetaddr, network, listenaddr string, acceptCIDRs []string) (clos ip := net.ParseIP(strings.Split(proxyconn.RemoteAddr().String(), ":")[0]) - var accpet bool - for i := 0; i < len(matchfunc); i++ { - accpet = accpet || matchfunc[i](ip) + var deny bool + for i := 0; !deny && i < len(matchfunc); i++ { + deny = deny && !matchfunc[i](ip) } - if !accpet { + if deny { //返回Deny select { default: