[net-dns-users] section RR counts read only

Dick Franks rwfranks at acm.org
Wed Dec 19 15:31:10 UTC 2012


On 19 December 2012 02:38, John Kristoff <jtk at cymru.com> wrote:
> I had some code that set qdcount, ancount, nscount and arcount in the
> header of a crafted Net::DNS message.  Well, I was setting them and I
> assume it worked, but I hadn't tested it in awhile.  I recently
> discovered that Net::DNS behavior changed between 0.68 and 0.69 that
> permits you to only now read these values.
>
> This isn't a big deal, but being able to set them, as I recall I was
> able to do anyway, was useful for seeing how various implementations
> would react. If it's not a big deal to bring back that functionality, it
> might come in handy.

It should *never* come in handy!

If the packet arrived on the wire, the counts are set from the header
which, in the absence of corruption or truncation, will be identical
to the number of RRs in the corresponding section.

For packets not decoded from the wire, the count is obtained from the
size of the relevant section and automatically tracks any changes of
the contents.

If you do attempt to change ancount etc., the request will fail
silently.  (This is to avoid upsetting some of the Net::DNS::SEC
modules, which still follow the old model).


Dick
--



More information about the net-dns-users mailing list