From: Remi Gacogne Date: Mon, 3 Jul 2017 11:04:58 +0000 (+0200) Subject: rec: Only increase `no-packet-error` on the first read X-Git-Tag: rec-4.1.0-alpha1~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5488%2Fhead;p=thirdparty%2Fpdns.git rec: Only increase `no-packet-error` on the first read We try to read as many messages as possible after being woken up, but only the first read can count as a no-packet error. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 2220f192c8..51f9325140 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1729,12 +1729,16 @@ static void handleNewUDPQuestion(int fd, FDMultiplexer::funcparam_t& var) struct msghdr msgh; struct iovec iov; char cbuf[256]; + bool firstQuery = true; fromaddr.sin6.sin6_family=AF_INET6; // this makes sure fromaddr is big enough fillMSGHdr(&msgh, &iov, cbuf, sizeof(cbuf), data, sizeof(data), &fromaddr); for(;;) if((len=recvmsg(fd, &msgh, 0)) >= 0) { + + firstQuery = false; + if(t_remotes) t_remotes->push_back(fromaddr); @@ -1807,8 +1811,9 @@ static void handleNewUDPQuestion(int fd, FDMultiplexer::funcparam_t& var) } else { // cerr<