From 048f5db6944a83f61f8ab3534ff56ad5045de7cc Mon Sep 17 00:00:00 2001 From: Andreas Jakum Date: Fri, 13 Nov 2015 16:04:38 +0100 Subject: [PATCH] Add counter for ignored packets to recursor statistics (+docs). Turns out recursor can be kept rather busy dealing with packets that will not show up anywhere. --- docs/markdown/recursor/stats.md | 1 + pdns/pdns_recursor.cc | 4 ++++ pdns/rec_channel_rec.cc | 1 + pdns/syncres.hh | 1 + 4 files changed, 7 insertions(+) diff --git a/docs/markdown/recursor/stats.md b/docs/markdown/recursor/stats.md index 88182b2c2..cef77567b 100644 --- a/docs/markdown/recursor/stats.md +++ b/docs/markdown/recursor/stats.md @@ -30,6 +30,7 @@ The `rec_control get` command can be used to query the following statistics, eit * `edns-ping-matches`: number of servers that sent a valid EDNS PING response * `edns-ping-mismatches`: number of servers that sent an invalid EDNS PING response * `failed-host-entries`: number of servers that failed to resolve +* `ignored-packets`: counts the number of non-query packets received on server sockets that should only get query packets * `ipv6-outqueries`: number of outgoing queries over IPv6 * `ipv6-questions`: counts all end-user initiated queries with the RD bit set, received over IPv6 UDP * `malloc-bytes`: returns the number of bytes allocated by the process (broken, always returns 0) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index d0e9c9740..3039229f2 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1040,11 +1040,13 @@ void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) dc->setRemote(&conn->d_remote); if(dc->d_mdp.d_header.qr) { delete dc; + g_stats.ignoredCount++; L<d_remote.toString() <<" on server socket!"<d_mdp.d_header.opcode) { delete dc; + g_stats.ignoredCount++; L<d_remote.toString() <<" on server socket!"<qr) { + g_stats.ignoredCount++; if(g_logCommonErrors) L<opcode) { + g_stats.ignoredCount++; if(g_logCommonErrors) L<opcode<<" from "<