Skip to contentSkip to conversation

ifconfig and SIOCSIFADDR

DISCUSSION [email protected] 1 participant 1 message Jul 25, 2001

lore
Share & tools
lore
#0 lore raw

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