aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/settings.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-18 15:12:48 -0700
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-18 15:12:48 -0700
commit850bd22ef47c1b0fca3894ece46ae6384200d7d9 (patch)
tree7f50b41cb77beaf6d73314ba9939dff6d71f4ba7 /src/plugins/lua/settings.lua
parent72ef530bb9765752410f2aaa2d75b97302a1671e (diff)
downloadrspamd-850bd22ef47c1b0fca3894ece46ae6384200d7d9.tar.gz
rspamd-850bd22ef47c1b0fca3894ece46ae6384200d7d9.zip
Refactor lua_ip slightly
Diffstat (limited to 'src/plugins/lua/settings.lua')
-rw-r--r--src/plugins/lua/settings.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 234c31b6d..6022c620d 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -54,8 +54,12 @@ local function check_settings(task)
end
local function check_ip_setting(rule, ip)
- -- XXX: check mask
- if ip:to_string() == rule[0] then
+ if rule[1] ~= nil then
+ local nip = ip:apply_mask(rule[1])
+ if nip and nip == rule[0] then
+ return true
+ end
+ elseif ip == rule[0] then
return true
end