]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add a comment wrt hashing the header
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 9 May 2022 06:43:07 +0000 (08:43 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 1 Jun 2022 09:23:55 +0000 (11:23 +0200)
pdns/packetcache.hh

index 08c3546fb13612d0a543d9b987038c2ee08b8347..2da156cb0b20ab343a877a6ba46da2008616bff8 100644 (file)
@@ -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<const unsigned char*>(&packet.at(2)), sizeof(dnsheader) - 2, 0); // rest of dnsheader, skip id
 
     for (pos = sizeof(dnsheader); pos < packetSize; ) {