]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: update canHashPacket() calls accordingly
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Fri, 1 Oct 2021 15:46:39 +0000 (17:46 +0200)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Fri, 1 Oct 2021 15:46:39 +0000 (17:46 +0200)
pdns/auth-packetcache.cc
pdns/test-packetcache_cc.cc

index 15f2bf358a4dce7878d1f9f77f24d0ec33e109ba..0a4a835c09f1cf1fb99468360b977c2f3b43e8ef 100644 (file)
@@ -58,7 +58,8 @@ bool AuthPacketCache::get(DNSPacket& p, DNSPacket& cached)
 
   cleanupIfNeeded();
 
-  uint32_t hash = canHashPacket(p.getString(), /* don't skip ECS */ false);
+  static const std::unordered_set<uint16_t> optionsToSkip{ EDNSOptionCode::COOKIE};
+  uint32_t hash = canHashPacket(p.getString(), /* don't skip ECS */optionsToSkip);
   p.setHash(hash);
 
   string value;
index e37c4b062ee363df0912e228677b88a988b60413..5fcfff8216aab30b4db38b773d2fb44a5f95c3b0 100644 (file)
@@ -165,7 +165,7 @@ try
        we directly compute the hash instead of querying the
        cache because 1/ it's faster 2/ no deferred-lookup issues
     */
-    q.setHash(g_PC->canHashPacket(q.getString(), false));
+    q.setHash(g_PC->canHashPacket(q.getString()));
 
     const unsigned int maxTTL = 3600;
     g_PC->insert(q, r, maxTTL);