Skip to content

Commit 407867c

Browse files
ahupowerdnsmind04
authored andcommitted
mind04 discovered we count corrupt packets and EAGAIN situations as validly received packets, skewing the udp questions/answers graphs on auth.
1 parent f06d069 commit 407867c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pdns/common_startup.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,8 @@ void declareStats(void)
256256
S.declareRing("remotes","Remote server IP addresses");
257257
S.declareRing("remotes-unauth","Remote hosts querying domains for which we are not auth");
258258
S.declareRing("remotes-corrupt","Remote hosts sending corrupt packets");
259-
260259
}
261260

262-
263261
int isGuarded(char **argv)
264262
{
265263
char *p=strstr(argv[0],"-instance");
@@ -315,14 +313,15 @@ void *qthread(void *number)
315313
}
316314

317315
for(;;) {
316+
if(!(P=NS->receive(&question))) { // receive a packet inline
317+
continue; // packet was broken, try again
318+
}
319+
318320
if (skipfirst)
319321
skipfirst=false;
320322
else
321323
numreceived++;
322324

323-
if(!(P=NS->receive(&question))) { // receive a packet inline
324-
continue; // packet was broken, try again
325-
}
326325

327326
if(P->d_remote.getSocklen()==sizeof(sockaddr_in))
328327
numreceived4++;

0 commit comments

Comments
 (0)