]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make a distinction between "ordinary" negcache results and entire name results. 12334/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 3 Jan 2023 08:24:05 +0000 (09:24 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 3 Jan 2023 08:24:05 +0000 (09:24 +0100)
pdns/recursordist/syncres.cc

index db9861951467aaeb97899f9c47e7c481aec119ff..5acacf5652506a48bf097760440dde8a52a571c9 100644 (file)
@@ -2822,13 +2822,15 @@ bool SyncRes::doCacheCheck(const DNSName& qname, const DNSName& authname, bool w
         if (ne.d_qtype.getCode()) {
           LOG(prefix << qname << ": " << qtype << " is negatively cached via '" << ne.d_auth << "' for another " << sttl << " seconds" << endl);
           res = RCode::NoError;
+          if (s_addExtendedResolutionDNSErrors) {
+            context.extendedError = EDNSExtendedError{0, "Result from negative cache"};
+          }
         }
         else {
           LOG(prefix << qname << ": Entire name '" << qname << "' is negatively cached via '" << ne.d_auth << "' for another " << sttl << " seconds" << endl);
-        }
-        if (s_addExtendedResolutionDNSErrors) {
-          // XXX Do we want this?
-          context.extendedError = EDNSExtendedError{0, "Result from negative cache"};
+          if (s_addExtendedResolutionDNSErrors) {
+            context.extendedError = EDNSExtendedError{0, "Result from negative cache for entire name"};
+          }
         }
       }
     }