Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2005 13:41:31 +0100 (BST)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        "Paul T. Root" <ptroot@iaces.com>
Cc:        Greg Black <gjb@gbch.net>, Mark Andrews <Mark_Andrews@isc.org>, freebsd-stable@freebsd.org
Subject:   Re: Resolver doesn't like 1.2.3.04 in /etc/hosts
Message-ID:  <Pine.GSO.4.62.0510271338440.10652@mail.ilrt.bris.ac.uk>
In-Reply-To: <4360C6A7.2080502@iaces.com>
References:  <200510262307.j9QN7G7V014335@drugs.dv.isc.org> <Pine.GSO.4.62.0510271304060.10652@mail.ilrt.bris.ac.uk> <4360C6A7.2080502@iaces.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 27 Oct 2005, Paul T. Root wrote:

> man inet_addr
> 
> and you'll find:
> 
> 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;
> otherwise, the number is interpreted as decimal).
> 
> 
> So a leading zero means hex. Stop trying to make it look pretty.
> 
> Standards are a good thing and need to be followed.

I also found:

[[[
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().
]]]

on that same man page :-)

Cheers,
jan

PS. I only raised the issue in case anyone else was bitten by it (which 
is why a PR might be handy). Having "fixed" /etc/hosts, I don't think 
this is worth wasting more energy on.



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