From 390f1dab05bbbb5d9ba2782e89600ca62c4bec14 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 3 Jul 2017 13:04:58 +0200 Subject: [PATCH] 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. --- pdns/pdns_recursor.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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<