From: Remi Gacogne Date: Thu, 26 Mar 2020 17:50:43 +0000 (+0100) Subject: dnsdist: Accept UDP datagrams larger than 1500 bytes for DNSCrypt X-Git-Tag: dnsdist-1.5.0-rc1~22^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8976%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Accept UDP datagrams larger than 1500 bytes for DNSCrypt --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 45ab97ea30..5f24f3f6cd 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1414,7 +1414,7 @@ static void MultipleMessagesUDPClientThread(ClientState* cs, LocalHolders& holde /* initialize the structures needed to receive our messages */ for (size_t idx = 0; idx < vectSize; idx++) { recvData[idx].remote.sin4.sin_family = cs->local.sin4.sin_family; - fillMSGHdr(&msgVec[idx].msg_hdr, &recvData[idx].iov, &recvData[idx].cbuf, sizeof(recvData[idx].cbuf), recvData[idx].packet, s_udpIncomingBufferSize, &recvData[idx].remote); + fillMSGHdr(&msgVec[idx].msg_hdr, &recvData[idx].iov, &recvData[idx].cbuf, sizeof(recvData[idx].cbuf), recvData[idx].packet, cs->dnscryptCtx ? sizeof(recvData[idx].packet) : s_udpIncomingBufferSize, &recvData[idx].remote); } /* go now */ @@ -1498,7 +1498,7 @@ try ComboAddress remote; ComboAddress dest; remote.sin4.sin_family = cs->local.sin4.sin_family; - fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), packet, s_udpIncomingBufferSize, &remote); + fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), packet, cs->dnscryptCtx ? sizeof(packet) : s_udpIncomingBufferSize, &remote); for(;;) { ssize_t got = recvmsg(cs->udpFD, &msgh, 0);