From: Remi Gacogne Date: Tue, 23 Feb 2021 08:59:58 +0000 (+0100) Subject: rec: Remove empty zones from the aggressive NSEC cache X-Git-Tag: dnsdist-1.6.0-alpha2~12^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e120e2bf9fddf825cc81ffb00c67fc2e5a510e9;p=thirdparty%2Fpdns.git rec: Remove empty zones from the aggressive NSEC cache --- diff --git a/pdns/recursordist/aggressive_nsec.cc b/pdns/recursordist/aggressive_nsec.cc index db0f0736ec..3e47588bc8 100644 --- a/pdns/recursordist/aggressive_nsec.cc +++ b/pdns/recursordist/aggressive_nsec.cc @@ -191,6 +191,14 @@ void AggressiveNSECCache::prune(time_t now) } d_entriesCount -= erased; + + if (!emptyEntries.empty()) + { + WriteLock rl(d_lock); + for (const auto& entry : emptyEntries) { + d_zones.remove(entry); + } + } } static bool isMinimallyCoveringNSEC(const DNSName& owner, const std::shared_ptr& nsec)