]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Accept UDP datagrams larger than 1500 bytes for DNSCrypt 8976/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Mar 2020 17:50:43 +0000 (18:50 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Mar 2020 17:50:43 +0000 (18:50 +0100)
pdns/dnsdist.cc

index 45ab97ea30f5902ee2b78afa07e3df8bd9ef787b..5f24f3f6cd71ef21308dfec26612cc35e45bc442 100644 (file)
@@ -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);