From: Otto Moerbeek Date: Wed, 23 Sep 2020 09:01:06 +0000 (+0200) Subject: Actually fix wipe-cache-typed X-Git-Tag: auth-4.4.0-alpha2~66^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7424549201fc8c7be0e8c49ba7b586f4d292b021;p=thirdparty%2Fpdns.git Actually fix wipe-cache-typed --- diff --git a/pdns/recursor_cache.cc b/pdns/recursor_cache.cc index 953562123f..4f209d3147 100644 --- a/pdns/recursor_cache.cc +++ b/pdns/recursor_cache.cc @@ -412,9 +412,13 @@ size_t MemRecursorCache::doWipeCache(const DNSName& name, bool sub, uint16_t qty auto range = idx.equal_range(name); auto i = range.first; while (i != range.second) { - i = idx.erase(i); - count++; - map.d_entriesCount--; + if (i->d_qtype == qtype || qtype == 0xffff) { + i = idx.erase(i); + count++; + map.d_entriesCount--; + } else { + ++i; + } } if (qtype == 0xffff) {