]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #6518 from rgacogne/rec-max-udp-queries-per-round
authorPieter Lexis <pieterlexis@users.noreply.github.com>
Thu, 24 May 2018 14:44:41 +0000 (16:44 +0200)
committerGitHub <noreply@github.com>
Thu, 24 May 2018 14:44:41 +0000 (16:44 +0200)
rec: Add a new max-udp-queries-per-round setting

1  2 
pdns/pdns_recursor.cc

index c618e31ede549a3f29a9307d62b7a3fbfe879621,159680227308b0e6f1aae75874b861c449b96474..4b20677c2e1a889d532f0857af206325c0fcef97
@@@ -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;