]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Handle unset 'zone' in policy RRL script 3614/head
authorHåkan Lindqvist <h@qw.se>
Sun, 6 Mar 2016 08:36:45 +0000 (09:36 +0100)
committerHåkan Lindqvist <h@qw.se>
Tue, 22 Mar 2016 23:10:37 +0000 (00:10 +0100)
pdns/policy-example-rrl.lua

index 4180c7718d974fd9dd16b911210a394c61c8e6f1..cd4f762877446730c55d61fb01ade69364b1b28a 100644 (file)
@@ -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?