From: | bconry@isc.org |
To: | bind9-public@isc.org |
Subject: | XML zone zonestats emitted with either wrong type or wrong names |
Date: | Wed, 06 Sep 2017 19:03:57 +0000 |
Looking at current git master
In bin/named/statschannel.c
in zone_xmlrender()
in the block:
zonestats = dns_zone_getrequeststats(zone);
rcvquerystats = dns_zone_getrcvquerystats(zone);
if (statlevel == dns_zonestat_full && zonestats != NULL) {
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "rcode"));
result = dump_counters(zonestats, isc_statsformat_xml, writer,
NULL, nsstats_xmldesc,
dns_nsstatscounter_max, nsstats_index,
nsstat_values, ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS)
goto error;
/* counters type="rcode"*/
TRY0(xmlTextWriterEndElement(writer));
}
paying attention only to the two statements:
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "rcode"));
result = dump_counters(zonestats, isc_statsformat_xml, writer,
NULL, nsstats_xmldesc,
dns_nsstatscounter_max, nsstats_index,
nsstat_values, ISC_STATSDUMP_VERBOSE);
Assuming that these stats are emitted, the "counters" container for them is given
a "type" attribute with value "rcode", yet the individual counters will be given
names from nsstats_xmldesc, which does not describe rcodes.
I have not traced things to identify when these stats will be emitted (if ever)
and what the actual contents of zonestats *mean*, but I can say confidently that
/at least/ one of "rcode" or nsstats_xmldesc is wrongfully applied to zonestats,
and possibly even both.