]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Backport to 4.8.x: Do *not* use QName Minimization for DS retrievals in QM fallback... 12442/head rec-4.8.1
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 2 Jan 2023 15:34:56 +0000 (16:34 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 18 Jan 2023 08:39:37 +0000 (09:39 +0100)
pdns/recursordist/rec-main.cc
pdns/syncres.cc
pdns/syncres.hh

index 415b7c83386a4067e385046856fce8c189823d45..a29c87b825951a55b9117bcc3406d9b26a706509 100644 (file)
@@ -2583,7 +2583,7 @@ int main(int argc, char** argv)
   try {
 #if HAVE_FIBER_SANITIZER
     // Asan needs more stack
-    ::arg().set("stack-size", "stack size per mthread") = "400000";
+    ::arg().set("stack-size", "stack size per mthread") = "600000";
 #else
     ::arg().set("stack-size", "stack size per mthread") = "200000";
 #endif
index 88a55a378934803dca3bb303d3e6f5de5363fa60..54602efabfb1faab8342034540bb249a5f356b34 100644 (file)
@@ -1753,6 +1753,8 @@ int SyncRes::doResolve(const DNSName &qname, const QType qtype, vector<DNSRecord
         // Case 5: unexpected answer
         QLOG("Step5: other rcode, last effort final resolve");
         setQNameMinimization(false);
+        setQMFallbackMode(true);
+
         // We might have hit a depth level check, but we still want to allow some recursion levels in the fallback
         // no-qname-minimization case. This has the effect that a qname minimization fallback case might reach 150% of
         // maxdepth.
@@ -3589,7 +3591,7 @@ vState SyncRes::getDSRecords(const DNSName& zone, dsmap_t& ds, bool taOnly, unsi
 
   vState state = vState::Indeterminate;
   const bool oldCacheOnly = setCacheOnly(false);
-  const bool oldQM = setQNameMinimization(true);
+  const bool oldQM = setQNameMinimization(!getQMFallbackMode());
   int rcode = doResolve(zone, QType::DS, dsrecords, depth + 1, beenthere, state);
   setCacheOnly(oldCacheOnly);
   setQNameMinimization(oldQM);
index df26b9ac4fa897a4a8d635313c55497278c6de68..1bdf1508b77b4a4495e7b569a6f332e61fd92544 100644 (file)
@@ -328,6 +328,18 @@ public:
     return old;
   }
 
+  bool setQMFallbackMode(bool state = true)
+  {
+    auto old = d_qNameMinimizationFallbackMode;
+    d_qNameMinimizationFallbackMode = state;
+    return old;
+  }
+
+  bool getQMFallbackMode() const
+  {
+    return d_qNameMinimizationFallbackMode;
+  }
+
   void setDoEDNS0(bool state=true)
   {
     d_doEDNS0=state;
@@ -664,6 +676,7 @@ private:
   bool d_wasOutOfBand{false};
   bool d_wasVariable{false};
   bool d_qNameMinimization{false};
+  bool d_qNameMinimizationFallbackMode{false};
   bool d_queryReceivedOverTCP{false};
   bool d_followCNAME{true};
   bool d_refresh{false};