Commit 44155b5d authored by bunkerity's avatar bunkerity
Browse files

dnsbl ipairs fix

parent 829c1c69
......@@ -24,7 +24,7 @@ access_by_lua_block {
end
local answers, err = r:reverse_query(ip)
if not answers.errcode then
for ak, av in pairs(answers) do
for ak, av in ipairs(answers) do
if av.ptrdname then
rdns = av.ptrdname
break
......@@ -33,7 +33,7 @@ access_by_lua_block {
end
if rdns ~= "" then
local answers, err, tries = r:query(rdns, nil, {})
for ak, av in pairs(answers) do
for ak, av in ipairs(answers) do
if av.address and av.address == ip then
both = true
break
......@@ -66,7 +66,7 @@ access_by_lua_block {
name = name:gsub("%.in%-addr%.arpa", ""):gsub("%.ip6%.arpa", "") .. "." .. v
local answers, err, tries = r:query(name, nil, {})
if not answers.errcode then
for ak, av in pairs(answers) do
for ak, av in ipairs(answers) do
if av.address then
a,b,c,d = av.address:match("([%d]+).([%d]+).([%d]+).([%d]+)")
if a == "127" then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment