From: bert hubert Date: Wed, 2 Mar 2016 12:02:58 +0000 (+0100) Subject: add a 'wants DNSSEC' metric to recursor X-Git-Tag: rec-4.0.0-alpha2~26^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b9853c909d9dcfa8e863f05215a97eaaa07cc33;p=thirdparty%2Fpdns.git add a 'wants DNSSEC' metric to recursor --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index a2775bdbea..cce6ab714b 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -508,6 +508,7 @@ uint16_t DNSKEYRecordContent::getTag() bool getEDNSOpts(const MOADNSParser& mdp, EDNSOpts* eo) { + eo->d_Z=0; if(mdp.d_header.arcount && !mdp.d_answers.empty()) { for(const MOADNSParser::answers_t::value_type& val : mdp.d_answers) { if(val.first.d_place == DNSResourceRecord::ADDITIONAL && val.first.d_type == QType::OPT) { diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 4f6f021aba..00887eac1a 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -634,8 +634,10 @@ void startDoResolve(void *p) sr.d_requestor=dc->d_remote; } - if(pw.getHeader()->cd || edo.d_Z & EDNSOpts::DNSSECOK) + if(pw.getHeader()->cd || edo.d_Z & EDNSOpts::DNSSECOK) { + g_stats.dnssecQueries++; sr.d_doDNSSEC=true; + } bool tracedQuery=false; // we could consider letting Lua know about this too bool variableAnswer = false; @@ -857,7 +859,6 @@ void startDoResolve(void *p) } sendit:; - g_rs.submitResponse(dc->d_mdp.d_qtype, packet.size(), !dc->d_tcp); updateResponseStats(res, dc->d_remote, packet.size(), &dc->d_mdp.d_qname, dc->d_mdp.d_qtype); if(!dc->d_tcp) { diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index e1f7a4130a..835ca5e5f0 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -624,6 +624,7 @@ RecursorControlParser::RecursorControlParser() addGetStat("edns-ping-matches", &g_stats.ednsPingMatches); addGetStat("edns-ping-mismatches", &g_stats.ednsPingMismatches); + addGetStat("dnssec-queries", &g_stats.dnssecQueries); addGetStat("noping-outqueries", &g_stats.noPingOutQueries); addGetStat("noedns-outqueries", &g_stats.noEdnsOutQueries); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 9cc243b659..b5bc2f9135 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -596,6 +596,7 @@ struct RecursorStats uint64_t noPacketError; uint64_t ignoredCount; time_t startupTime; + uint64_t dnssecQueries; unsigned int maxMThreadStackUsage; };