]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Remove empty zones from the aggressive NSEC cache
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Feb 2021 08:59:58 +0000 (09:59 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Feb 2021 08:59:58 +0000 (09:59 +0100)
pdns/recursordist/aggressive_nsec.cc

index db0f0736ecb1f97584414306e661ae1427c694f2..3e47588bc83c8345ddfcf7ec5b1e415443982e7a 100644 (file)
@@ -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<NSECRecordContent>& nsec)