]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
QName Minimization consults the cache first to see work needs to 8648/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 20 Dec 2019 09:08:50 +0000 (10:08 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 20 Dec 2019 09:13:53 +0000 (10:13 +0100)
be done. Via doCacheCheck() this can lead to a call to computeZoneCuts()
which might/does not work properly on only cached records, so always
make sure it can go out if needed. Should fix #8642.

pdns/syncres.cc

index e9371524c1ccec3213fda3c5bbc9cb100957aa4e..4e031a002a1813606f6e030b06bf180e7ed118cc 100644 (file)
@@ -2134,12 +2134,15 @@ void SyncRes::computeZoneCuts(const DNSName& begin, const DNSName& end, unsigned
     return;
   }
 
+  const bool oldCacheOnly = setCacheOnly(false);
+
   dsmap_t ds;
   vState cutState = getDSRecords(end, ds, false, depth);
   LOG(d_prefix<<": setting cut state for "<<end<<" to "<<vStates[cutState]<<endl);
   d_cutStates[end] = cutState;
 
   if (!shouldValidate()) {
+    setCacheOnly(oldCacheOnly);
     return;
   }
 
@@ -2212,6 +2215,7 @@ void SyncRes::computeZoneCuts(const DNSName& begin, const DNSName& end, unsigned
       LOG(" - "<<cut.first<<": "<<vStates[cut.second]<<endl);
     }
   }
+  setCacheOnly(oldCacheOnly);
 }
 
 vState SyncRes::validateDNSKeys(const DNSName& zone, const std::vector<DNSRecord>& dnskeys, const std::vector<std::shared_ptr<RRSIGRecordContent> >& signatures, unsigned int depth)