]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
if *fromCache is already true, no need to check CNAME chain
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 16 Dec 2024 16:13:49 +0000 (17:13 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Dec 2024 16:13:49 +0000 (17:13 +0100)
Co-authored-by: Remi Gacogne <github@coredump.fr>
pdns/recursordist/syncres.cc

index a3591e9311219d006d91d35ea1bd1a17d6ef21d0..20a7c3d4b4003707b21735cc8e89aea1ed106bd1 100644 (file)
@@ -2014,7 +2014,7 @@ int SyncRes::doResolveNoQNameMinimization(const DNSName& qname, const QType qtyp
         }
         // This handles the case mentioned above: if the full CNAME chain leading to the answer was
         // constructed from the cache, indicate that.
-        if (fromCache != nullptr && haveFinalAnswer(qname, qtype, res, ret)) {
+        if (fromCache != nullptr && *fromCache == false && haveFinalAnswer(qname, qtype, res, ret)) {
           *fromCache = true;
         }
         return res;
@@ -2066,7 +2066,7 @@ int SyncRes::doResolveNoQNameMinimization(const DNSName& qname, const QType qtyp
             }
           }
         }
-        if (fromCache != nullptr && haveFinalAnswer(qname, qtype, res, ret)) {
+        if (fromCache != nullptr && *fromCache == false && haveFinalAnswer(qname, qtype, res, ret)) {
           *fromCache = true;
         }
         return res;