Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 82047
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: calle [...] init.se
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Net::DNS::Header documentation is misleading
The documentation for Net::DNS::Header says for the qdcount, ancount, nscount and arcount methods that they return the number of records in the corresponding section of the packet. As discussed in ticket #81133, that is not necessarily the case. The documentation should, in my opinion, be rephrased to state that they return the values from the header, which may in the case of corrupt packets be different from the actual number of records.
From: rwfranks [...] acm.org
On Mon Dec 17 05:16:36 2012, CDYBED wrote: Show quoted text
> The documentation for Net::DNS::Header says for the qdcount, ancount, > nscount and arcount methods that they return the number of records in > the corresponding section of the packet. As discussed in ticket #81133, > that is not necessarily the case. The documentation should, in my > opinion, be rephrased to state that they return the values from the > header, which may in the case of corrupt packets be different from the > actual number of records.
I accept your point that there should be some words about the impact of corrupt packets. The return value is obtained from the packet header of a newly decoded packet and otherwise tracks the size of the corresponding RR list. If the inbound header itself is corrupt, the sections will contain the wrong RRs; there is no recovery from that.
Documentation has just been adapted. In Net::DNS::Header: ancount, prcount print "# of answer records: ", $packet->header->ancount, "\n"; Returns the number of records in the answer section of the packet which may, in the case of corrupt packets, differ from the actual number of records. In dynamic update packets, this field is known as "prcount" and refers to the number of RRs in the prerequisite section. nscount, upcount print "# of authority records: ", $packet->header->nscount, "\n"; Returns the number of records in the authority section of the packet which may, in the case of corrupt packets, differ from the actual number of records. In dynamic update packets, this field is known as "upcount" and refers to the number of RRs in the update section. arcount, adcount print "# of additional records: ", $packet->header->arcount, "\n"; Returns the number of records in the additional section of the packet which may, in the case of corrupt packets, differ from the actual number of records. In dynamic update packets, this field is known as "adcount". And in Net::DNS::Packet as the last paragraph on the new method: Note that the number of RRs in each section of the packet may differ from the corresponding header value if the data has been truncated or corrupted.