mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-09-09 19:44:59 +08:00
添加acl协议支持
This commit is contained in:
@@ -105,7 +105,15 @@ func checkLinkAcl(group *dbdata.Group, pl *sessdata.Payload) bool {
|
|||||||
// 先判断协议
|
// 先判断协议
|
||||||
// 兼容旧数据 v.Protocol == ""
|
// 兼容旧数据 v.Protocol == ""
|
||||||
if v.Protocol == "" || v.Protocol == dbdata.ALL || v.IpProto == ipProto {
|
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 dbdata.ContainsInPorts(v.Ports, ipPort) || dbdata.ContainsInPorts(v.Ports, 0) {
|
||||||
if v.Action == dbdata.Allow {
|
if v.Action == dbdata.Allow {
|
||||||
// log.Println(dbdata.Allow, v.Ports)
|
// log.Println(dbdata.Allow, v.Ports)
|
||||||
|
Reference in New Issue
Block a user