From: bert hubert Date: Wed, 10 Dec 2014 10:11:22 +0000 (+0100) Subject: mind04 discovered we count corrupt packets and EAGAIN situations as validly received... X-Git-Tag: auth-3.4.2~15^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=407867ca82a1cec2dbc89fc97d1cdac6940580b7;p=thirdparty%2Fpdns.git mind04 discovered we count corrupt packets and EAGAIN situations as validly received packets, skewing the udp questions/answers graphs on auth. --- diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 7aedc1fb90..d57b666c53 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -256,10 +256,8 @@ void declareStats(void) S.declareRing("remotes","Remote server IP addresses"); S.declareRing("remotes-unauth","Remote hosts querying domains for which we are not auth"); S.declareRing("remotes-corrupt","Remote hosts sending corrupt packets"); - } - int isGuarded(char **argv) { char *p=strstr(argv[0],"-instance"); @@ -315,14 +313,15 @@ void *qthread(void *number) } for(;;) { + if(!(P=NS->receive(&question))) { // receive a packet inline + continue; // packet was broken, try again + } + if (skipfirst) skipfirst=false; else numreceived++; - if(!(P=NS->receive(&question))) { // receive a packet inline - continue; // packet was broken, try again - } if(P->d_remote.getSocklen()==sizeof(sockaddr_in)) numreceived4++;