From: Andreas Jakum Date: Fri, 13 Nov 2015 15:04:38 +0000 (+0100) Subject: Add counter for ignored packets to recursor statistics (+docs). X-Git-Tag: dnsdist-1.0.0-alpha1~96^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2888%2Fhead;p=thirdparty%2Fpdns.git 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. --- diff --git a/docs/markdown/recursor/stats.md b/docs/markdown/recursor/stats.md index 88182b2c2d..cef77567bc 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 d0e9c97400..3039229f2e 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 "<