acl支持逗号分隔多端口号配置

This commit is contained in:
huweishan
2024-04-08 14:54:09 +08:00
parent 380a8cb3fb
commit 8df34428dd
3 changed files with 89 additions and 62 deletions

View File

@@ -89,7 +89,7 @@ func checkLinkAcl(group *dbdata.Group, pl *sessdata.Payload) bool {
// 循环判断ip和端口
if v.IpNet.Contains(ipDst) {
// 放行允许ip的ping
if v.Port == ipPort || v.Port == 0 || ipProto == waterutil.ICMP {
if dbdata.ContainsInPorts( v.Ports , ipPort) || v.Ports[0] == 0 || ipProto == waterutil.ICMP {
if v.Action == dbdata.Allow {
return true
} else {