From: HÃ¥kan Lindqvist Date: Sun, 6 Mar 2016 08:36:45 +0000 (+0100) Subject: Handle unset 'zone' in policy RRL script X-Git-Tag: dnsdist-1.0.0-beta1~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=953d480b0533eb84953f5e86adef949596148ca7;p=thirdparty%2Fpdns.git Handle unset 'zone' in policy RRL script --- diff --git a/pdns/policy-example-rrl.lua b/pdns/policy-example-rrl.lua index 4180c7718d..cd4f762877 100644 --- a/pdns/policy-example-rrl.lua +++ b/pdns/policy-example-rrl.lua @@ -85,7 +85,7 @@ function police (req, resp, isTcp) reqsize = req:getSize() respsize = resp:getSize() rcode = resp:getRcode() - print ("< ", qname, qtype, remote, "wild: "..(wild or "EMPTY"), "zone: "..zone, reqsize.."/"..respsize, rcode, isTcp ) + print ("< ", qname, qtype, remote, "wild: "..(wild or "EMPTY"), "zone: "..(zone or "EMPTY"), reqsize.."/"..respsize, rcode, isTcp ) if isTcp then return pdns.PASS end -- mywindow[1][1] = mywindow[1][1]+1 @@ -100,7 +100,7 @@ function police (req, resp, isTcp) imputedname = wild elseif rcode == pdns.NXDOMAIN or errorstatus then - imputedname = zone + imputedname = zone or "EMPTY" end token = mask(remote).."/"..imputedname.."/"..tostring(errorstatus) submit(mywindow[1], token) -- FIXME: only submit when doing PASS/TRUNCATE?