From: Charles-Henri Bruyand Date: Fri, 1 Oct 2021 15:46:39 +0000 (+0200) Subject: auth: update canHashPacket() calls accordingly X-Git-Tag: dnsdist-1.7.0-alpha2~34^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=717d8820a37091c3807bb27b60707e9dd71232f0;p=thirdparty%2Fpdns.git auth: update canHashPacket() calls accordingly --- diff --git a/pdns/auth-packetcache.cc b/pdns/auth-packetcache.cc index 15f2bf358a..0a4a835c09 100644 --- a/pdns/auth-packetcache.cc +++ b/pdns/auth-packetcache.cc @@ -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 optionsToSkip{ EDNSOptionCode::COOKIE}; + uint32_t hash = canHashPacket(p.getString(), /* don't skip ECS */optionsToSkip); p.setHash(hash); string value; diff --git a/pdns/test-packetcache_cc.cc b/pdns/test-packetcache_cc.cc index e37c4b062e..5fcfff8216 100644 --- a/pdns/test-packetcache_cc.cc +++ b/pdns/test-packetcache_cc.cc @@ -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);