[ldns-users] TTL Parsing

Charles Hubbard charles.hubbard at edgeintelligence.com
Thu Sep 20 15:50:51 UTC 2018


Thanks Tony, that's very helpful.

Charlie

On Thu, Sep 20, 2018 at 4:44 PM, Tony Finch <dot at dotat.at> wrote:

> Charles Hubbard <charles.hubbard at edgeintelligence.com> wrote:
> >
> > I noticed that the TTL is defined as a signed int32
> > https://www.ietf.org/rfc/rfc1035.txt
> > but as an unsigned int32 by ldns.
> >
> > Is this a bug?
>
> RFC 2181 says it is a bug in RFC 1035 :-)
>
> https://tools.ietf.org/html/rfc2181#section-8
>
>    The definition of values appropriate to the TTL field in STD 13 is
>    not as clear as it could be, with respect to how many significant
>    bits exist, and whether the value is signed or unsigned.  It is
>    hereby specified that a TTL value is an unsigned number, with a
>    minimum value of 0, and a maximum value of 2147483647.  That is, a
>    maximum of 2^31 - 1.  When transmitted, this value shall be encoded
>    in the less significant 31 bits of the 32 bit TTL field, with the
>    most significant, or sign, bit set to zero.
>
>    Implementations should treat TTL values received with the most
>    significant bit set as if the entire value received was zero.
>
> Tony.
> --
> f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
> Rockall, Malin: West, veering northwest, 5 to 7, increasing gale 8 at
> times.
> Rough or very rough, occasionally moderate in Malin. Squally showers.
> Moderate
> or good.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20180920/6712807a/attachment.htm>


More information about the ldns-users mailing list