From: Otto Moerbeek Date: Mon, 8 Sep 2025 14:24:06 +0000 (+0200) Subject: rec: do not hash (or compare) OpenTelemetry Trace EDNS value for packetcache X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F16098%2Fhead;p=thirdparty%2Fpdns.git rec: do not hash (or compare) OpenTelemetry Trace EDNS value for packetcache Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/recpacketcache.cc b/pdns/recursordist/recpacketcache.cc index 9005bb62f..144bc67b3 100644 --- a/pdns/recursordist/recpacketcache.cc +++ b/pdns/recursordist/recpacketcache.cc @@ -103,6 +103,8 @@ uint64_t RecursorPacketCache::doWipePacketCache(const DNSName& name, uint16_t qt return count; } +static const std::unordered_set s_skipOptions = {EDNSOptionCode::ECS, EDNSOptionCode::COOKIE, EDNSOptionCode::OTTRACEIDS}; + bool RecursorPacketCache::qrMatch(const packetCache_t::index::type::iterator& iter, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass) { // this ignores checking on the EDNS subnet flags! @@ -110,8 +112,7 @@ bool RecursorPacketCache::qrMatch(const packetCache_t::index::type::ite return false; } - static const std::unordered_set optionsToSkip{EDNSOptionCode::COOKIE, EDNSOptionCode::ECS}; - return queryMatches(iter->d_query, queryPacket, qname, optionsToSkip); + return queryMatches(iter->d_query, queryPacket, qname, s_skipOptions); } bool RecursorPacketCache::checkResponseMatches(MapCombo::LockedContent& shard, std::pair::type::iterator, packetCache_t::index::type::iterator> range, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass, time_t now, std::string* responsePacket, uint32_t* age, vState* valState, OptPBData* pbdata) @@ -171,8 +172,6 @@ bool RecursorPacketCache::checkResponseMatches(MapCombo::LockedContent& shard, s return false; } -static const std::unordered_set s_skipOptions = {EDNSOptionCode::ECS, EDNSOptionCode::COOKIE}; - bool RecursorPacketCache::getResponsePacket(unsigned int tag, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass, time_t now, std::string* responsePacket, uint32_t* age, vState* valState, uint32_t* qhash, OptPBData* pbdata, bool tcp) {