添加acl协议支持

This commit is contained in:
bjdgyc 2024-09-04 13:13:31 +08:00
parent cd21ffd7ab
commit 5b498cbc59
1 changed files with 9 additions and 1 deletions

View File

@ -105,7 +105,15 @@ func checkLinkAcl(group *dbdata.Group, pl *sessdata.Payload) bool {
// 先判断协议
// 兼容旧数据 v.Protocol == ""
if v.Protocol == "" || v.Protocol == dbdata.ALL || v.IpProto == ipProto {
// 全部通过
if ipProto == waterutil.ICMP {
// icmp 不判断端口
if v.Action == dbdata.Allow {
return true
} else {
return false
}
}
if dbdata.ContainsInPorts(v.Ports, ipPort) || dbdata.ContainsInPorts(v.Ports, 0) {
if v.Action == dbdata.Allow {
// log.Println(dbdata.Allow, v.Ports)