MartÃn Ferrari wrote:
Hi Peter,
On 5/29/07, Peter Clapham <[EMAIL PROTECTED]> wrote:
Error appears to be due to ifconfig taking 08 as an invalid octal value
rather than a binary with leading 0. Error also affects ifup/ifdown if
/etc/network/interfaces has similar entries. Values 01->07 accepted as
they are valid octal units.
Ifconfig uses inet_aton to check if you provided an ip address, if it
says it's invalid, it will try to resolve it with DNS.
inet_aton will accept many formats of ip address, dotted-decimal,
dotted-octal, dotted-hex, and raw decimal, octal and hex addresses:
ifconfig eth1 0x0f.0x0f.0x0f.0x0f
ifconfig eth1 15.15.15.15
ifconfig eth1 017.017.017.017
ifconfig eth1 0x0f0f0f0f
ifconfig eth1 01234567123
ifconfig eth1 999999999
All of these are valid, although inet_aton doesn't document this. If
you provide a string which is invalid to inet_aton, such as an invalid
octal, it will try with gethostbyname and then you see the error you
mentioned.
This is exactly as we'd observed, many thanks for checking this out
so quickly, much appreciated.
It's odd that there is no apparent parsing of the ip for a decimal octal
format
mixture and spit out a related error or possibly more reasonably a warning ?
unknown host is a tad abstract :-)
So, I'm not even sure if this could be considered a bug. In any case,
it's libc fault...
What do you think?
I can certainly appreciate the number of layers involved and hence the
potential opportunities for the decimal octal mix to be picked up. As to
which package should take responsibility for this...
inet_aton, should check BUT...
It is reasonable to expect some degree of sanity checking within net-tools
apps, as well as an update to the man pages and a potential user
warning if such a mix is detected. Not having the above is still (I think)
a bug in net-tools.
Another alternative would be to use inet_pton which rejects octal ?
Thanks again and hope the above helps
Pete
The Wellcome Trust Sanger Institute is operated by Genome Research Limited,
a charity registered in England with number 1021457 and a company
registered in England with number 2742969, whose registered office is
215 Euston Road, London, NW1 2BE.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]