]> 127.0.0.1 Git - part/.git/commitdiff
1 v0.28.20240413084255
authorqydysky <qydysky@foxmail.com>
Sat, 13 Apr 2024 08:37:41 +0000 (08:37 +0000)
committerqydysky <qydysky@foxmail.com>
Sat, 13 Apr 2024 08:37:41 +0000 (08:37 +0000)
Net.go

diff --git a/Net.go b/Net.go
index 8c89074e839d8dd3926adf3039af3274a6837e9d..8815459f6abf3588900135c64739dd53cf613d13 100644 (file)
--- 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: