Re: ifconfig strangeness

Philip Blundell (philb@gnu.org)
Sun, 17 Jan 1999 18:33:25 +0100


>ifconfig eth0 129.13.242.6 netmask 255.255.255.0
>results in a broadcast address 129.13.0.0 (not a usefull value IMO).
>is there a way to use the given information (ip and netmask)
>and choose 129.13.242.0, which is correct.
>
>or is there some situation where the current behavior is desired.

Ifconfig isn't really at fault. When it asks the kernel to set the
address, the kernel guesses a netmask on the basis of the IP address
(class B in this case) and chooses a broadcast address accordingly.
Ifconfig then changes the netmask to what you specified but this
doesn't automatically affect the broadcast address.

If you add `broadcast xx.xx.xx.xx' to your ifconfig command line the
right thing will happen. I guess it would be possible to make
ifconfig a bit smarter so that it spotted this situation and overrode
the kernel's guess at the broadcast address, but I'm not sure if it's
particularly desirable.

p.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/