Subject: Re: Patch to add TTL to returned structures for SOA, TXT, SRV and MX

Re: Patch to add TTL to returned structures for SOA, TXT, SRV and MX

From: Tommie Gannert <tommie_at_spotify.com>
Date: Mon, 5 Aug 2013 10:26:15 +0200

2013/7/31 Mark Delany <e9y_at_bravo.emu.st>

> (Resent. I don't think it made the list last time)
>
> Hi.
>
> I didn't get much discussion from my previous thread so I went ahead
> and made a minimalist patch to add ttl to the end of the structures of
> most of the missing ones.
>
> The changes to each parse method are the same. A ttl has been added to
> the end of the returned structure and the parse code has been changed
> to populate that field.
>
> Since the field is at the end of the structure, that should have no
> impact on existing code. I didn't see the point in inventing a whole
> new structure with the additional ttl field.
>

If you're linking to a shared library c-ares and the header version is
wrong, you're going to have a fun exploit vector.

A couple of thoughts:

* For the above reason, I think this should bump the SO file version in
Makefile.am.
 * Indentation is mixed in the patch (some c-ares files are tab-indented,
but all changes use spaces.)
 * ares_parse_soa_reply.c: Removing
aptr += ...
doesn't look safe here as the first
ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname, &len);
uses aptr.
 * I think the man page should state the returned TTL is in seconds.
   (Not everyone knows the DNS protocol.)

-- 
Tommie
Received on 2013-08-05