From: Otto Moerbeek Date: Mon, 9 May 2022 06:43:07 +0000 (+0200) Subject: Add a comment wrt hashing the header X-Git-Tag: auth-4.8.0-alpha0~57^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c2c5503ca528fc750cd3d89a4f8ead265b2588d;p=thirdparty%2Fpdns.git Add a comment wrt hashing the header --- diff --git a/pdns/packetcache.hh b/pdns/packetcache.hh index 08c3546fb1..2da156cb0b 100644 --- a/pdns/packetcache.hh +++ b/pdns/packetcache.hh @@ -107,6 +107,10 @@ public: { const size_t packetSize = packet.size(); assert(packetSize >= sizeof(dnsheader)); + // Quite some bits in the header are actually irrelevant for + // incoming queries. If we ever change that and ignore them for + // hashing, don't forget to also adapt the `queryHeaderMatches` + // code, as it should be consistent with the hash function. uint32_t currentHash = burtle(reinterpret_cast(&packet.at(2)), sizeof(dnsheader) - 2, 0); // rest of dnsheader, skip id for (pos = sizeof(dnsheader); pos < packetSize; ) {