From 3fd3a8e6b708401ca14204f0ab71501c08f16d78 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Sun, 15 Feb 2015 22:25:57 +0200 Subject: [PATCH] Don't use to_number() when checking radix maps --- src/plugins/lua/ip_score.lua | 6 ++---- src/plugins/lua/multimap.lua | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua index 1ba267dce..6da59c3ed 100644 --- a/src/plugins/lua/ip_score.lua +++ b/src/plugins/lua/ip_score.lua @@ -68,8 +68,7 @@ local ip_score_set = function(task) if action then -- Check whitelist if whitelist then - local ipnum = task:get_from_ip():to_number() - if task:get_from_ip():is_valid() and whitelist:get_key(ipnum) then + if task:get_from_ip():is_valid() and whitelist:get_key(task:get_from_ip()) then -- Address is whitelisted return end @@ -131,8 +130,7 @@ local ip_score_check = function(task) local ip = task:get_from_ip() if ip:is_valid() then if whitelist then - local ipnum = task:get_from_ip():to_number() - if whitelist:get_key(ipnum) then + if whitelist:get_key(task:get_from_ip()) then -- Address is whitelisted return end diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 0a809ca52..6af38a40c 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -57,7 +57,7 @@ local function check_multimap(task) end else local ip = task:get_from_ip() - if ip:is_valid() and rule['ips'] and rule['ips']:get_key(ip:to_number()) then + if ip:is_valid() and rule['ips'] and rule['ips']:get_key(ip) then task:insert_result(rule['symbol'], 1) end end -- 2.39.5