]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
increase UDP receive buffer size
authorKees Monshouwer <mind04@monshouwer.org>
Fri, 12 Jul 2013 12:04:21 +0000 (14:04 +0200)
committermind04 <mind04@monshouwer.org>
Fri, 12 Jul 2013 17:46:25 +0000 (19:46 +0200)
pdns/common_startup.cc
pdns/dnspacket.cc
pdns/nameserver.cc

index fb37f659733c40efcc757530ecd5b73ed818f5fd..7f35aac40d6b6a1aba0404efbc0a0df737afb38a 100755 (executable)
@@ -341,7 +341,7 @@ void mainthread()
    
    g_anyToTcp = ::arg().mustDo("any-to-tcp");
    g_addSuperfluousNSEC3 = ::arg().mustDo("add-superfluous-nsec3-for-old-bind");
-   DNSPacket::s_udpTruncationThreshold = ::arg().asNum("udp-truncation-threshold");
+   DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold"));
    DNSPacket::s_doEDNSSubnetProcessing = ::arg().mustDo("edns-subnet-processing");
    
 #ifndef WIN32
index 5e4eae691c562bc51c2d36ea825d689acf5c3102..aa43c4d8a561e3f0ce70f5ca26c7bc54b3fa3feb 100644 (file)
@@ -329,7 +329,7 @@ void DNSPacket::wrapup()
 
       if(!opts.empty() || d_haveednssection || d_dnssecOk)
       {
-        pw.addOpt(2800, 0, d_dnssecOk ? EDNSOpts::DNSSECOK : 0, opts);
+        pw.addOpt(s_udpTruncationThreshold, 0, d_dnssecOk ? EDNSOpts::DNSSECOK : 0, opts);
         pw.commit();
       }
     }
index 3efe3ca7c26570b898e7b3e9ebd87a180b780e21..d00eb96637c6aeffe89b1147ce19fecad68d41f3 100644 (file)
@@ -355,9 +355,9 @@ DNSPacket *UDPNameserver::receive(DNSPacket *prefilled)
   ComboAddress remote;
   extern StatBag S;
   int len=-1;
-  char mesg[512];
+  char mesg[DNSPacket::s_udpTruncationThreshold];
   Utility::sock_t sock=-1;
-    
+
   struct msghdr msgh;
   struct iovec iov;
   char cbuf[256];