]> source.dussan.org Git - rspamd.git/commitdiff
Fix misusage of ip object.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 3 Apr 2014 11:43:14 +0000 (12:43 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 3 Apr 2014 11:43:14 +0000 (12:43 +0100)
src/plugins/lua/multimap.lua

index 8b094aa80999358287db0196b4f9fbd3b38f8715..aac0f5159041dc2a71eafad23ed2fa8f8b45b2a5 100644 (file)
@@ -24,12 +24,12 @@ local function check_multimap(task)
                if rule['type'] == 'ip' then
                        if rule['cdb'] then
                                local ip = task:get_from_ip()
-                               if ip:is_valid() and rule['hash']:lookup(ip) then
+                               if ip:is_valid() and rule['hash']:lookup(ip:to_string()) then
                                        task:insert_result(rule['symbol'], 1)
                                end
                        else
-                               local ip = task:get_from_ip():to_number()
-                               if ip:is_valid() and rule['ips'] and rule['ips']:get_key(ip) then
+                               local ip = task:get_from_ip()
+                               if ip:is_valid() and rule['ips'] and rule['ips']:get_key(ip:to_number()) then
                                        task:insert_result(rule['symbol'], 1)
                                end
                        end