non operational question related to IP

Brian Reichert reichert at
Mon Nov 22 16:22:04 CST 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


  If the af argument of inet_pton() is AF_INET, the src string shall be in
  the standard IPv4 dotted-decimal form:


  where "ddd" is a one to three digit decimal number between 0 and 255 (see

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:

     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

As does Linux():

      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

  If the af argument is AF_INET, the function accepts a string in
  the standard IPv4 dotted-decimal form:


   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.


I've never been happy with inconsistencies in serializing data structures...

> Ken Matlock
> Network Analyst
> Exempla Healthcare
> (303) 467-4671
> matlockk at

Brian Reichert				<reichert at>
55 Crystal Ave. #286			
Derry NH 03038-1725 USA			BSD admin/developer at large	

More information about the NANOG mailing list