From: Oliver Chen Date: Sat, 10 May 2025 03:56:07 +0000 (+0000) Subject: add missing empty condition check on payload rank option X-Git-Tag: dnsdist-2.0.0-beta1~36^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c77398cb04b61e79558fc4a2cfa2fb903ed48528;p=thirdparty%2Fpdns.git add missing empty condition check on payload rank option --- diff --git a/pdns/dnsdistdist/dnsdist-cache.cc b/pdns/dnsdistdist/dnsdist-cache.cc index 44a53b4b1a..0a861165c6 100644 --- a/pdns/dnsdistdist/dnsdist-cache.cc +++ b/pdns/dnsdistdist/dnsdist-cache.cc @@ -466,7 +466,7 @@ uint32_t DNSDistPacketCache::getKey(const DNSName::string_t& qname, size_t qname throw std::range_error("Computing packet cache key for an invalid packet (" + std::to_string(packet.size()) + " < " + std::to_string(sizeof(dnsheader) + qnameWireLength) + ")"); } if (packet.size() > ((sizeof(dnsheader) + qnameWireLength))) { - if (!d_settings.d_optionsToSkip.empty()) { + if (!d_settings.d_optionsToSkip.empty() || !d_settings.d_payloadRanks.empty()) { /* skip EDNS options if any */ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) result = PacketCache::hashAfterQname(std::string_view(reinterpret_cast(packet.data()), packet.size()), result, sizeof(dnsheader) + qnameWireLength, d_settings.d_optionsToSkip, d_settings.d_payloadRanks);