]> 127.0.0.1 Git - part/.git/commitdiff
1 v0.28.20240414155905
authorqydysky <qydysky@foxmail.com>
Sun, 14 Apr 2024 15:54:02 +0000 (15:54 +0000)
committerqydysky <qydysky@foxmail.com>
Sun, 14 Apr 2024 15:54:02 +0000 (15:54 +0000)
Net.go

diff --git a/Net.go b/Net.go
index 107b9b8068bd652bd7e859d618c6ca810fb4cac2..276df4312c20f2197dc3f536bb168f8827daef6d 100644 (file)
--- a/Net.go
+++ b/Net.go
@@ -245,11 +245,11 @@ func Forward(targetaddr, listenaddr string, acceptCIDRs []string) (closef func()
 
                        ip := net.ParseIP(strings.Split(proxyconn.RemoteAddr().String(), ":")[0])
 
-                       var deny bool
-                       for i := 0; !deny && i < len(matchfunc); i++ {
-                               deny = deny || !matchfunc[i](ip)
+                       var accept bool
+                       for i := 0; !accept && i < len(matchfunc); i++ {
+                               accept = accept || matchfunc[i](ip)
                        }
-                       if deny {
+                       if !accept {
                                //返回Deny
                                select {
                                default: