]> granicus.if.org Git - pdns/commitdiff
rec: Use a 512-byte buffer for incoming queries instead of 1500
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 1 Jun 2018 10:05:15 +0000 (12:05 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 8 Jun 2018 06:04:32 +0000 (08:04 +0200)
pdns/pdns_recursor.cc
pdns/recursordist/RECURSOR-MIB.txt
pdns/recursordist/docs/metrics.rst

index d469a0eb6db5499cf24f3d3d841e30db30b5774f..f3f71e5b52eafe990e74fa898888e82daaab5d69 100644 (file)
@@ -2011,6 +2011,7 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr
 static void handleNewUDPQuestion(int fd, FDMultiplexer::funcparam_t& var)
 {
   ssize_t len;
+  static const size_t maxIncomingQuerySize = 512;
   static thread_local std::string data;
   ComboAddress fromaddr;
   struct msghdr msgh;
@@ -2018,7 +2019,7 @@ static void handleNewUDPQuestion(int fd, FDMultiplexer::funcparam_t& var)
   char cbuf[256];
   bool firstQuery = true;
 
-  data.resize(1500);
+  data.resize(maxIncomingQuerySize);
   fromaddr.sin6.sin6_family=AF_INET6; // this makes sure fromaddr is big enough
   fillMSGHdr(&msgh, &iov, cbuf, sizeof(cbuf), &data[0], data.size(), &fromaddr);
 
index aecea2b1e0a45ab1fedaf0568f02cce89b7eecc3..35d933ea29e9b711201aec2113331dc478273e10 100644 (file)
@@ -771,7 +771,7 @@ truncatedDrops OBJECT-TYPE
     MAX-ACCESS read-only
     STATUS current
     DESCRIPTION
-        "Number of queries dropped because they were larger than 1500 bytes"
+        "Number of queries dropped because they were larger than 512 bytes"
     ::= { stats 93 }
 
 ---
index 309fbbf8c9644f678bc2d8879774372793a8904f..4ee63b45c7fe71731d91dd71544246155db6fd7c 100644 (file)
@@ -430,7 +430,7 @@ truncated-drops
 ^^^^^^^^^^^^^^^
 .. versionadded:: 4.2
 
-questions dropped because they were larger than 1500 bytes
+questions dropped because they were larger than 512 bytes
 
 unauthorized-tcp
 ^^^^^^^^^^^^^^^^