Implements CIDR-matching of flow exclusion list rules

This commit is contained in:
Simone Mainardi 2021-02-12 17:24:26 +01:00
parent 37559ece7b
commit 7e1a3ef51f
2 changed files with 25 additions and 6 deletions

View file

@ -161,8 +161,8 @@ function ipv4_utils.includes(network, netmask, ip)
local lower = network
local upper = ipv4_utils.broadcast_address(network, netmask)
return (ipv4_utils.cmp(ip, lower) > 0) and
(ipv4_utils.cmp(ip, upper) < 0)
return (ipv4_utils.cmp(ip, lower) >= 0) and
(ipv4_utils.cmp(ip, upper) <= 0)
end
-- Get the broadcast address for the given netmask