From: Otto Moerbeek Date: Mon, 28 Mar 2022 08:21:02 +0000 (+0200) Subject: Use correct index for LRU delete X-Git-Tag: rec-4.7.0-beta1~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11312%2Fhead;p=thirdparty%2Fpdns.git Use correct index for LRU delete --- diff --git a/pdns/recpacketcache.cc b/pdns/recpacketcache.cc index 697e56de71..8d68e10c58 100644 --- a/pdns/recpacketcache.cc +++ b/pdns/recpacketcache.cc @@ -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(); + seq_idx.erase(seq_idx.begin()); } - } uint64_t RecursorPacketCache::bytes() const