Re: ifconfig and SIOCSIFADDR

Date: Wed Jul 25 2001 - 14:23:55 EST

    From Wed Jul 25 18:37:10 2001

> and the last ioctl destroys the information set by the previous two.


> I consider this a kernel bug,

    No. And even not a feature, but just the only eligible way.
    SIOCSIFADDR resets all previously set address information

Yes. It didn't in 2.0. It does in 2.2 and 2.4.

    BTW, if no address was selected before, setting netmask
    and broadcast etc. simply fails.
    So that you had some address set on the interface before
    you did the operation and that netmask is set for _that_ address_.

Yes. I liked such logic thirty years ago. That is Unix.
Today I am less sure that it is a good idea to expect users
to read the kernel and ifconfig sources, but I did and know.

Since you don't like changing the current behaviour, we should
probably document it (say, in ifconfig(8)).


       ifconfig interface [aftype] [address] options

       Since options are read and transmitted to the kernel
       in the order given, and since giving an address parameter
       causes resetting address related information (such as
       netmask and broadcast address) to a default, any non-default
       such address related information should be given after the
       address parameter (if any).
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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