]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use correct index for LRU delete 11312/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 28 Mar 2022 08:21:02 +0000 (10:21 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 08:09:47 +0000 (10:09 +0200)
pdns/recpacketcache.cc

index 697e56de71ed4ddd6315792434a87b915469fe82..8d68e10c58652f6ae80fcf5432f6b2708fdb8d5c 100644 (file)
@@ -192,10 +192,9 @@ void RecursorPacketCache::insertResponsePacket(unsigned int tag, uint32_t qhash,
   d_packetCache.insert(e);
 
   if (d_packetCache.size() > d_maxSize) {
-    auto it = d_packetCache.begin();
-    d_packetCache.erase(it);
+    auto& seq_idx = d_packetCache.get<SequencedTag>();
+    seq_idx.erase(seq_idx.begin());
   }
-
 }
 
 uint64_t RecursorPacketCache::bytes() const