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.

So, I'm not even sure if this could be considered a bug. In any case,
it's libc fault...
What do you think?

--
Martín Ferrari

Reply via email to