From: Kees Monshouwer Date: Fri, 12 Jul 2013 12:04:21 +0000 (+0200) Subject: increase UDP receive buffer size X-Git-Tag: rec-3.6.0-rc1~556^2~3^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1cd66b8ef6891d9e80057492022f3c75383373d4;p=thirdparty%2Fpdns.git increase UDP receive buffer size --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index fb37f65973..7f35aac40d 100755 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -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 diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index 5e4eae691c..aa43c4d8a5 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -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(); } } diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index 3efe3ca7c2..d00eb96637 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -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];