]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
QName Minimization consults the cache first to see work needs to
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>
Mon, 6 Jan 2020 16:09:52 +0000 (17:09 +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.

(cherry picked from commit 0eb07f3a5c23cc94c95a2bed022367085f8dfcef)

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)