Re: ifconfig and SIOCSIFADDR

From: Andries.Brouwer@cwi.nl
Date: Wed Jul 25 2001 - 15:26:58 EST


        Hello!

And hello again!

> Yes. It didn't in 2.0.

        Soooory, it did. This behavior is copied from there. :-)

You are mistaken. I already quoted you the source.
In case you do not believe in source reading I can demo as well.

2.4:
# ifconfig lo netmask 255.254.0.0 10.0.0.150
# ifconfig lo
lo Link encap:Local Loopback
          inet addr:10.0.0.150 Mask:255.0.0.0
[2.4.6, net-tools 1.60]

2.0:
# ifconfig lo netmask 255.254.0.0 10.0.0.150
# ifconfig lo
lo Link encap:Local Loopback
          inet addr:10.0.0.150 Bcast:127.255.255.255 Mask:255.254.0.0

[2.0.34, net-tools 1.33]

As you see, the behaviour where setting the address kills
the already set netmask is new.

> Yes. I liked such logic thirty years ago. That is Unix.

        :-) Seems, thirty years ago there were not only Internet but Unix too.

Yes, rounded to a nice number. I suppose we started using Unix
26 or 27 years ago or so.

        BTW I did not hear about any kind of Unix, which forgets
        to set a valid mask on newly selected address.

Linux 2.0, when there already is a nonzero mask.
A zero mask is replaced by a default:

2.0:
# ifconfig lo netmask 0.0.0.0 10.0.0.150
# ifconfig lo
lo Link encap:Local Loopback
          inet addr:10.0.0.150 Bcast:127.255.255.255 Mask:255.0.0.0
...

Andries

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



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:24 EST