]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Ignore cache-only for DNSKEYs retrieval
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 3 Jul 2020 15:29:33 +0000 (17:29 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 13 Jul 2020 14:24:04 +0000 (16:24 +0200)
When the DNSKEYs are needed for validation, the initial RD flag
should not prevent us from going to the network.

(cherry picked from commit 38a7e82df8eaa8bee8fe9b444e81e1d71710d4de)

pdns/syncres.cc

index cd86a67f9fdc14f6a398acb7bdeeb17d0a327f34..0121c05acf7e59a6961b336dd28d636dc5d50097 100644 (file)
@@ -2326,11 +2326,14 @@ vState SyncRes::getDNSKeys(const DNSName& signer, skeyset_t& keys, unsigned int
   LOG(d_prefix<<"Retrieving DNSKeys for "<<signer<<endl);
 
   vState state = Indeterminate;
+
   /* following CNAME might lead to us to the wrong DNSKEY */
   bool oldSkipCNAME = d_skipCNAMECheck;
   d_skipCNAMECheck = true;
+  const bool oldCacheOnly = setCacheOnly(false);
   int rcode = doResolve(signer, QType(QType::DNSKEY), records, depth + 1, beenthere, state);
   d_skipCNAMECheck = oldSkipCNAME;
+  setCacheOnly(oldCacheOnly);
 
   if (rcode == RCode::NoError) {
     if (state == Secure) {