]> granicus.if.org Git - pdns/commitdiff
dnsdist: Don't cache entries larger than 4096 bytes
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 11 Oct 2019 12:52:08 +0000 (14:52 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 15 Oct 2019 08:06:54 +0000 (10:06 +0200)
We won't be able to use them anyway.

pdns/dnsdist.cc

index 4b826767c3a2442fc0b2a2ccb07a322db926919e..08d5ceeb283e78c95199c4a48fbe3941a3278e4d 100644 (file)
@@ -439,7 +439,7 @@ bool processResponse(char** response, uint16_t* responseLen, size_t* responseSiz
     return false;
   }
 
-  if (dr.packetCache && !dr.skipCache) {
+  if (dr.packetCache && !dr.skipCache && *responseLen <= s_maxPacketCacheEntrySize) {
     if (!dr.useZeroScope) {
       /* if the query was not suitable for zero-scope, for
          example because it had an existing ECS entry so the hash is