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

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 27 Oct 2005, Mark Andrews wrote:

> 
> > On 2005-10-26, Mark Andrews wrote:
> > > 	Leading zeros are ambigious.  Some platforms treat them as octal
> > > 	others treat them as decimal.
> > 
> > There is nothing ambiguous about the example provided.  (Perhaps
> > it wasn't a good example, but it's always a bug if '04' is not
> > correctly decoded, regardless of the numeric base in use.)
> 
> 	You want a ambigious example?
> 
> 		192.168.222.012

It amazed me that no RFC ever appears to have standardised this format 
(although it is alluded to in passing as being decimal in various other 
places). Eg, 1035 has:

[[[
 The RDATA section of
an A line in a master file is an Internet address expressed as four
decimal numbers separated by dots without any imbedded spaces (e.g.,
"10.2.0.52" or "192.0.5.6").
]]]

(although that's DNS zone file format, not /etc/hosts.)

> 	It's much easier to just reject octal and hexadecimal than
> 	to work out when and when not it is ambigious.  It is also
> 	better to demand all 4 octets.  It also generates less
> 	support complaints.

I'm happy to reject octal and hex too! Anyway, count this as one (minor) 
support gripe :-)

Thanks for your time,
jan


-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44 (0)117 3317661   http://ioctl.org/jan/
stty intr ^m



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