Resolver doesn't like 1.2.3.04 in /etc/hosts

Jan Grant Jan.Grant at bristol.ac.uk
Thu Oct 27 05:07:26 PDT 2005


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


More information about the freebsd-stable mailing list