aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordpetrov67 <dpetrov67@gmail.com>2023-02-14 12:16:53 -0500
committerGitHub <noreply@github.com>2023-02-14 12:16:53 -0500
commit817fcffcd6f244bbb43fe4efab4dc497d83610a7 (patch)
tree68527d3875669614e609a35f00b59e8a7a5b415e
parent4028247ac6bba30731efc1ee346c6752ae6eb3c3 (diff)
downloadrspamd-817fcffcd6f244bbb43fe4efab4dc497d83610a7.tar.gz
rspamd-817fcffcd6f244bbb43fe4efab4dc497d83610a7.zip
Fix process_ip_condition() to support global maps
-rw-r--r--src/plugins/lua/settings.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 136de077a..db2f264e7 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -255,10 +255,10 @@ local function check_ip_setting(expected, ip)
else
if expected[2] ~= 0 then
local nip = ip:apply_mask(expected[2])
- if nip and nip:to_string() == expected[1]:to_string() then
+ if nip and nip:to_string() == expected[1] then
return true
end
- elseif ip:to_string() == expected[1]:to_string() then
+ elseif ip:to_string() == expected[1] then
return true
end
end
@@ -478,18 +478,18 @@ local function process_ip_condition(ip)
local res = rspamd_ip.from_string(ip)
if res:is_valid() then
- out[1] = res
+ out[1] = res:to_string()
out[2] = 0
else
-- It can still be a map
- out[1] = res
+ out[1] = ip
end
else
local res = rspamd_ip.from_string(string.sub(ip, 1, slash - 1))
local mask = tonumber(string.sub(ip, slash + 1))
if res:is_valid() then
- out[1] = res
+ out[1] = res:to_string()
out[2] = mask
else
rspamd_logger.errx(rspamd_config, "bad IP address: " .. ip)