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
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
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