From: Remi Gacogne Date: Thu, 10 Oct 2019 15:44:43 +0000 (+0200) Subject: dnsdist: Advertise the size really available in the query buffer X-Git-Tag: dnsdist-1.4.0-rc4~22^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be7dec02ae8bbb6fac253240691668c4ab86d140;p=pdns dnsdist: Advertise the size really available in the query buffer We use to advertise s_udpIncomingBufferSize (1500) but the buffer is really 4096 bytes long. This allows much larger responses from to be returned from the cache. --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index ba9760548..177cd4493 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1787,7 +1787,7 @@ try ComboAddress remote; ComboAddress dest; remote.sin4.sin_family = cs->local.sin4.sin_family; - fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), packet, sizeof(packet), &remote); + fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), packet, s_udpIncomingBufferSize, &remote); for(;;) { ssize_t got = recvmsg(cs->udpFD, &msgh, 0); @@ -1797,7 +1797,7 @@ try continue; } - processUDPQuery(*cs, holders, &msgh, remote, dest, packet, static_cast(got), s_udpIncomingBufferSize, nullptr, nullptr, nullptr, nullptr); + processUDPQuery(*cs, holders, &msgh, remote, dest, packet, static_cast(got), sizeof(packet), nullptr, nullptr, nullptr, nullptr); } } }