]> granicus.if.org Git - pdns/commitdiff
rec: Don't directly store NSEC3 records in the positive cache
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 19 Oct 2017 09:57:32 +0000 (11:57 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 19 Oct 2017 09:57:32 +0000 (11:57 +0200)
pdns/syncres.cc

index f5cbe00732382b3bc67745cec9a7ee195ce7ad3f..dc7e8110befccdd1816f314c88335975713ce8b9 100644 (file)
@@ -1918,7 +1918,14 @@ RCode::rcodes_ SyncRes::updateCacheFromRecords(unsigned int depth, LWResult& lwr
       }
     }
 
-    t_RC->replace(d_now.tv_sec, i->first.name, QType(i->first.type), i->second.records, i->second.signatures, authorityRecs, isAA, i->first.place == DNSResourceRecord::ANSWER ? ednsmask : boost::none, recordState);
+    /* We don't need to store NSEC3 records in the positive cache because:
+       - we don't allow direct NSEC3 queries
+       - denial of existence proofs in wildcard expanded positive responses are stored in authorityRecs
+       - denial of existence proofs for negative responses are stored in the negative cache
+    */
+    if (i->first.type != QType::NSEC3) {
+      t_RC->replace(d_now.tv_sec, i->first.name, QType(i->first.type), i->second.records, i->second.signatures, authorityRecs, isAA, i->first.place == DNSResourceRecord::ANSWER ? ednsmask : boost::none, recordState);
+    }
 
     if(i->first.place == DNSResourceRecord::ANSWER && ednsmask)
       d_wasVariable=true;