From 79cc1d60fcb0b8de2375557ed963d266625e87f5 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 3 Jan 2023 09:24:05 +0100 Subject: [PATCH] Make a distinction between "ordinary" negcache results and entire name results. --- pdns/recursordist/syncres.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index db98619514..5acacf5652 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -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"}; + } } } } -- 2.47.2