non operational question related to IP
Brian Reichert
reichert at numachi.com
Mon Nov 22 22:22:04 UTC 2010
On Mon, Nov 22, 2010 at 12:56:00PM -0700, Matlock, Kenneth L wrote:
> 'Octal' (Base-8) :)
>
> The leading '0' is telling the box to interpret it as octal instead of
> decimal or hex.
My guess you're seeing an interface that uses inet_addr() instead
of inet_pton(); the latter is used more nowadays at it supports
both IPv4 and IPv6 addressing schemes.
Whereas I've seen this behavior with a lot of vendors, I'm tempted
to call it a bug:
The Open Group Base Specifications Issue 6
IEEE Std 1003.1, 2004 Edition
http://www.opengroup.org/onlinepubs/009695399/functions/inet_ntop.html
inet_pton():
If the af argument of inet_pton() is AF_INET, the src string shall be in
the standard IPv4 dotted-decimal form:
ddd.ddd.ddd.ddd
where "ddd" is a one to three digit decimal number between 0 and 255 (see
inet_addr()).
No mention of dotted quad being anything other than 'decimal', much
less getting cute about guessing the radix.
The *BSD manpages for inet_pton() call out a similar constraint:
http://www.freebsd.org/cgi/man.cgi?query=inet_aton&apropos=0&sektion=0&manpath=FreeBSD+8.1-RELEASE&format=html
STANDARDS
The inet_ntop() and inet_pton() functions conform to X/Open
Networking Services Issue 5.2 (``XNS5.2''). Note that inet_pton()
does not accept 1-, 2-, or 3-part dotted addresses; all four
parts must be specified and are interpreted only as decimal
values. This is a narrower input set than that accepted by
inet_aton().
As does Linux():
http://www.kernel.org/doc/man-pages/online/pages/man3/inet_pton.3.html
AF_INET
src points to a character string containing an IPv4 network
address in dotted-decimal format, "ddd.ddd.ddd.ddd", ...
RFC 2553 also calls out the non-decimal interpretation as being
'non-standard':
http://www.ietf.org/rfc/rfc2553.txt
If the af argument is AF_INET, the function accepts a string in
the standard IPv4 dotted-decimal form:
ddd.ddd.ddd.ddd
where ddd is a one to three digit decimal number between 0 and 255.
Note that many implementations of the existing inet_addr() and
inet_aton() functions accept nonstandard input: octal numbers,
hexadecimal numbers, and fewer than four numbers. inet_pton() does
not accept these formats.
Etc.
I've never been happy with inconsistencies in serializing data structures...
> Ken Matlock
> Network Analyst
> Exempla Healthcare
> (303) 467-4671
> matlockk at exempla.org
--
Brian Reichert <reichert at numachi.com>
55 Crystal Ave. #286
Derry NH 03038-1725 USA BSD admin/developer at large
More information about the NANOG
mailing list