]> source.dussan.org Git - rspamd.git/commitdiff
Don't use to_number() when checking radix maps 173/head
authorAndrew Lewis <nerf@judo.za.org>
Sun, 15 Feb 2015 20:25:57 +0000 (22:25 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Sun, 15 Feb 2015 20:28:36 +0000 (22:28 +0200)
src/plugins/lua/ip_score.lua
src/plugins/lua/multimap.lua

index 1ba267dce51c7849ebee029c816cfc85697ecbdd..6da59c3ed64cde56cd95b1794f56ffb192ae31ca 100644 (file)
@@ -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
index 0a809ca5242509ab5d4ebe07ea74c1f240305741..6af38a40cea7ed7d1a95627cf67effc34cc66b84 100644 (file)
@@ -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