]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Also consider recursive forward in the "forwarded DS should not end up in negCache... 12201/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 16 Nov 2022 12:58:04 +0000 (13:58 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 16 Nov 2022 13:44:12 +0000 (14:44 +0100)
With @rgacogne and @phonedph1
Fixes #12189

(cherry picked from commit af746aaf59a2e977bafabd5814635f59b01e5835)

pdns/syncres.cc

index 443b94fd63e9d0056dc602ab8fe918cb55af6a19..a72820d5ce456efdf5055261a5a36e928d69228c 100644 (file)
@@ -1029,7 +1029,7 @@ bool SyncRes::isRecursiveForwardOrAuth(const DNSName &qname) const {
 bool SyncRes::isForwardOrAuth(const DNSName &qname) const {
   DNSName authname(qname);
   domainmap_t::const_iterator iter = getBestAuthZone(&authname);
-  return iter != t_sstorage.domainmap->end() && (iter->second.isAuth() || !iter->second.shouldRecurse());
+  return iter != t_sstorage.domainmap->end();
 }
 
 // Will be needed in the future
@@ -4711,16 +4711,16 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co
         continue;
       }
     }
-    const bool negCacheIndiction = rec.d_place == DNSResourceRecord::AUTHORITY && rec.d_type == QType::SOA &&
+    const bool negCacheIndication = rec.d_place == DNSResourceRecord::AUTHORITY && rec.d_type == QType::SOA &&
       lwr.d_rcode == RCode::NXDomain && qname.isPartOf(rec.d_name) && rec.d_name.isPartOf(auth);
 
     bool putInNegCache = true;
-    if (negCacheIndiction && qtype == QType::DS && isForwardOrAuth(qname)) {
+    if (negCacheIndication && qtype == QType::DS && isForwardOrAuth(qname)) {
       // #10189, a NXDOMAIN to a DS query for a forwarded or auth domain should not NXDOMAIN the whole domain
       putInNegCache = false;
     }
 
-    if (negCacheIndiction) {
+    if (negCacheIndication) {
       LOG(prefix<<qname<<": got negative caching indication for name '"<<qname<<"' (accept="<<rec.d_name.isPartOf(auth)<<"), newtarget='"<<newtarget<<"'"<<endl);
 
       rec.d_ttl = min(rec.d_ttl, s_maxnegttl);