From: Pieter Lexis Date: Thu, 24 May 2018 14:44:41 +0000 (+0200) Subject: Merge pull request #6518 from rgacogne/rec-max-udp-queries-per-round X-Git-Tag: dnsdist-1.3.1~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a54a129448357275b8899ab2303cdd59ff69a3f;p=pdns Merge pull request #6518 from rgacogne/rec-max-udp-queries-per-round rec: Add a new max-udp-queries-per-round setting --- 8a54a129448357275b8899ab2303cdd59ff69a3f diff --cc pdns/pdns_recursor.cc index c618e31ed,159680227..4b20677c2 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@@ -2000,11 -1994,10 +2001,11 @@@ static void handleNewUDPQuestion(int fd char cbuf[256]; bool firstQuery = true; + data.resize(1500); fromaddr.sin6.sin6_family=AF_INET6; // this makes sure fromaddr is big enough - fillMSGHdr(&msgh, &iov, cbuf, sizeof(cbuf), data, sizeof(data), &fromaddr); + fillMSGHdr(&msgh, &iov, cbuf, sizeof(cbuf), &data[0], data.size(), &fromaddr); - for(;;) + for(size_t counter = 0; counter < s_maxUDPQueriesPerRound; counter++) if((len=recvmsg(fd, &msgh, 0)) >= 0) { firstQuery = false;