]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Apply suggestions from code review 13021/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 17 Jul 2023 10:10:35 +0000 (12:10 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 20 Jul 2023 08:28:53 +0000 (10:28 +0200)
Co-authored-by: Remi Gacogne <github@coredump.fr>
pdns/recursordist/pdns_recursor.cc

index ba9771580d7c29c3efe969bd71632e981887a0f4..78cce382f5c81acfb44689300f9606d513805e5a 100644 (file)
@@ -908,6 +908,8 @@ static uint32_t capPacketCacheTTL(const struct dnsheader& hdr, uint32_t ttl, boo
 
 static void addPolicyTagsToPBMessageIfNeeded(DNSComboWriter& comboWriter, pdns::ProtoZero::RecMessage& pbMessage)
 {
+  /* we do _not_ want to store policy tags set by the gettag hook into the packet cache,
+     since the call to gettag for subsequent queries could yield the same PC tag but different policy tags */
   if (!comboWriter.d_gettagPolicyTags.empty()) {
     for (const auto& tag : comboWriter.d_gettagPolicyTags) {
       comboWriter.d_policyTags.erase(tag);
@@ -1693,7 +1695,7 @@ void startDoResolve(void* arg) // NOLINT(readability-function-cognitive-complexi
       }
       pbMessage.setInBytes(packet.size());
       pbMessage.setValidationState(resolver.getValidationState());
-      // See if we want to store the policyTags into th PC
+      // See if we want to store the policyTags into the PC
       addPolicyTagsToPBMessageIfNeeded(*comboWriter, pbMessage);
 
       // Take s snap of the current protobuf buffer state to store in the PC