]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: fix link attribute validation with IFLA_GROUP
authorPatrick McHardy <kaber@trash.net>
Thu, 20 Jan 2011 03:00:42 +0000 (03:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jan 2011 07:28:54 +0000 (23:28 -0800)
commit269e82bb2331eb4b9c4a6b8d331a693c0b1257bc
treefb09699460d85166bfa64c524eb6eda01b899c4a
parent80cbbde6f97a5df5aaac9dc775f6ddd95862062f
rtnetlink: fix link attribute validation with IFLA_GROUP

rtnl_group_changelink() is invoked by rtnl_newlink() before the link
attributes have been validated. Additionally the group changes are
performed even if NLM_F_CREATE is specified and a new link is
created, while more reasonable semantics would be to set the group
value on the newly created link.

Fix both problems by moving the rtnl_group_changelink() invocation
down to the handling of non-existant links without NLM_F_CREATE()
and add a dev_set_group() call to rtnl_create_link().

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Vlad Dogaru <ddvlad@rosedu.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c