diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-08-18 15:12:48 -0700 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-08-18 15:12:48 -0700 |
commit | 850bd22ef47c1b0fca3894ece46ae6384200d7d9 (patch) | |
tree | 7f50b41cb77beaf6d73314ba9939dff6d71f4ba7 /src/plugins/lua/settings.lua | |
parent | 72ef530bb9765752410f2aaa2d75b97302a1671e (diff) | |
download | rspamd-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.lua | 8 |
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 |