From: bert hubert Date: Tue, 2 Feb 2016 21:29:15 +0000 (+0100) Subject: make sure we log if we refresh an expired dynamic rule. Closes #3323 X-Git-Tag: dnsdist-1.0.0-alpha2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e126e7ddfba324414f34c4826b8704645dc42355;p=thirdparty%2Fpdns.git make sure we log if we refresh an expired dynamic rule. Closes #3323 --- diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index 3c2c06f0dd..9b52a4ad16 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -166,15 +166,18 @@ void moreLua() for(const auto& capair : m) { unsigned int count = 0; auto got = slow.lookup(Netmask(capair.first)); + bool expired=false; if(got) { if(until < got->second.until) // had a longer policy continue; - if(now < got->second.until) // don't inherit count on expired entry + if(now < got->second.until) // only inherit count on fresh query we are extending count=got->second.blocks; + else + expired=true; } DynBlock db{msg,until}; db.blocks=count; - if(!got) + if(!got || expired) warnlog("Inserting dynamic block for %s for %d seconds: %s", capair.first.toString(), actualSeconds, msg); slow.insert(Netmask(capair.first)).second=db; }