]> granicus.if.org Git - pdns/commitdiff
and add support for not query-caching scopemasked answers
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 29 May 2013 14:25:11 +0000 (16:25 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 29 May 2013 14:25:11 +0000 (16:25 +0200)
pdns/ueberbackend.cc

index 4f73028ff4ad70660ebe8fb5a3eb4bc55c41d887..9d2a35ac25caca16ad8100b1ba97a0d8440e86ff 100644 (file)
@@ -347,6 +347,7 @@ void UeberBackend::addNegCache(const Question &q)
   static int negqueryttl=::arg().asNum("negquery-cache-ttl");
   if(!negqueryttl)
     return;
+  // we should also not be storing negative answers if a pipebackend does scopeMask, but we can't pass a negative scopeMask in an empty set!
   PC.insert(q.qname, q.qtype, PacketCache::QUERYCACHE, "", negqueryttl, q.zoneId);
 }
 
@@ -367,6 +368,8 @@ void UeberBackend::addCache(const Question &q, const vector<DNSResourceRecord> &
   BOOST_FOREACH(DNSResourceRecord rr, rrs) {
     if (rr.ttl < queryttl)
       cachettl = rr.ttl;
+    if (rr.scopeMask)
+      return;
   }
 
   boa << rrs;