]> granicus.if.org Git - pdns/commitdiff
dnsdist: Advertise the size really available in the query buffer
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 10 Oct 2019 15:44:43 +0000 (17:44 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 15 Oct 2019 08:06:13 +0000 (10:06 +0200)
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.

pdns/dnsdist.cc

index ba9760548668c3386c06be0a8d9c8285e514490d..177cd44931acad80ff99a8baffd67bf4d13c65fc 100644 (file)
@@ -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<uint16_t>(got), s_udpIncomingBufferSize, nullptr, nullptr, nullptr, nullptr);
+      processUDPQuery(*cs, holders, &msgh, remote, dest, packet, static_cast<uint16_t>(got), sizeof(packet), nullptr, nullptr, nullptr, nullptr);
     }
   }
 }