]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Actually fix wipe-cache-typed
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 23 Sep 2020 09:01:06 +0000 (11:01 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 23 Sep 2020 09:01:06 +0000 (11:01 +0200)
pdns/recursor_cache.cc

index 953562123f6821b505976643a8f829cb8c08588f..4f209d3147c098f40a2e9039ea36d1073954e83b 100644 (file)
@@ -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) {