Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2002 21:38:14 -0400
From:      Leo Bicknell <bicknell@ufp.org>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: inet_aton() Bug or feature?
Message-ID:  <20021004013814.GA70364@ussenterprise.ufp.org>
In-Reply-To: <20021003195515.GA92263@blossom.cjclark.org>
References:  <1136947159.20021003160026@yahoo.com> <20021003195515.GA92263@blossom.cjclark.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In a message written on Thu, Oct 03, 2002 at 12:55:15PM -0700, Crist J. Clark wrote:
> This is a feature not a bug since it is documented in inet_aton(3),
> 
>      All numbers supplied as ``parts'' in a `.' notation may be decimal,
>      octal, or hexadecimal, as specified in the C language (i.e., a leading 0x
>      or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other-
>      wise, the number is interpreted as decimal).

While I agree it's documented, does it agree with practice?

The earliest reference I could find was RFC 952
(ftp://ftp.isi.edu/in-notes/rfc952.txt):

   2. Internet Addresses are 32-bit addresses [See RFC-796].  In the
   host table described herein each address is represented by four
   decimal numbers separated by a period.  Each decimal number
   represents 1 octet.

There are several other references to this format, including some later
RFC's with BNF forms that have similar specifications.

It would seem some people believe "dotted quad" format addresses are
always composed of /decimal/ components.  While I had no idea things
like "0xffffff00" were just handded to inet_aton (although it makes
some sense), it would seem to me much better if:

0xffffff00       was hex,
0123456701234567 was octal,
010.010.010.010  was 4 decimal parts

I was very surprised from the poster that 192.168.0.010 might actually
be 192.168.0.8.

-- 
       Leo Bicknell - bicknell@ufp.org - CCIE 3440
        PGP keys at http://www.ufp.org/~bicknell/
Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021004013814.GA70364>