]> git.baikalelectronics.ru Git - kernel.git/commit
[RTNETLINK]: Allow changing of subsets of netdevice flags in rtnl_setlink
authorPatrick McHardy <kaber@trash.net>
Wed, 23 May 2007 00:00:01 +0000 (17:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 May 2007 00:00:01 +0000 (17:00 -0700)
commitf8dd8213cd3ad1067e4fac7f9b9f7189adeddae2
treec4c31034bd85034845974de89ddff52ab04dfdcf
parent37a309606e93ff8911efc4a8fb85e4d454eb3850
[RTNETLINK]: Allow changing of subsets of netdevice flags in rtnl_setlink

rtnl_setlink doesn't allow to change subsets of the flags, just to override
the set entirely by a new one. This means that for simply setting a device
up or down userspace first needs to query the current flags, change it and
send the changed flags back, which is racy and needlessly complicated.

Mask the flags using ifi_change since this is what it is intended for.
For backwards compatibility treat ifi_change == 0 as ~0 (even though it
seems quite unlikely that anyone has been using this so far).

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c