]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Handle unset 'wild' in RRL policy script
authorHåkan Lindqvist <h@qw.se>
Sat, 5 Mar 2016 20:40:45 +0000 (21:40 +0100)
committerHåkan Lindqvist <h@qw.se>
Sat, 5 Mar 2016 20:40:45 +0000 (21:40 +0100)
pdns/policy-example-rrl.lua

index 79cb04b115c70e35b1d9e29f43996b182c290f85..4180c7718d974fd9dd16b911210a394c61c8e6f1 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, "zone: "..zone, reqsize.."/"..respsize, rcode, isTcp )
+               print ("< ", qname, qtype, remote, "wild: "..(wild or "EMPTY"), "zone: "..zone, reqsize.."/"..respsize, rcode, isTcp )
                if isTcp then return pdns.PASS end
 
                -- mywindow[1][1] = mywindow[1][1]+1
@@ -95,7 +95,7 @@ function police (req, resp, isTcp)
                imputedname = qname
                errorstatus = (rcode == pdns.REFUSED or rcode == pdns.FORMERR or rcode == pdns.SERVFAIL or rcode == pdns.NOTIMP)
 
-               if wild:len() > 0
+               if wild
                then
                        imputedname = wild
                elseif rcode == pdns.NXDOMAIN or errorstatus