From: HÃ¥kan Lindqvist Date: Sat, 5 Mar 2016 20:40:45 +0000 (+0100) Subject: Handle unset 'wild' in RRL policy script X-Git-Tag: dnsdist-1.0.0-beta1~20^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec44713bd3f0071bc3424f23ea416c022f478cb2;p=thirdparty%2Fpdns.git Handle unset 'wild' in RRL policy script --- diff --git a/pdns/policy-example-rrl.lua b/pdns/policy-example-rrl.lua index 79cb04b115..4180c7718d 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, "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