diff options
author | Vlad Dogaru <ddvlad@rosedu.org> | 2011-01-13 23:38:30 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-19 23:31:09 -0800 |
commit | cbda10fa97d72c7a1923be4426171aa90e8c6dab (patch) | |
tree | 113206ef603189e9f91f075e154cbdc8e1ac3f40 /net/core/rtnetlink.c | |
parent | 441c793a56502638d45d5da2195056d686147370 (diff) | |
download | linux-3.10-cbda10fa97d72c7a1923be4426171aa90e8c6dab.tar.gz linux-3.10-cbda10fa97d72c7a1923be4426171aa90e8c6dab.tar.bz2 linux-3.10-cbda10fa97d72c7a1923be4426171aa90e8c6dab.zip |
net_device: add support for network device groups
Net devices can now be grouped, enabling simpler manipulation from
userspace. This patch adds a group field to the net_device structure, as
well as rtnetlink support to query and modify it.
Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a5f7535aab5..09062b07bf7 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -868,6 +868,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, netif_running(dev) ? dev->operstate : IF_OPER_DOWN); NLA_PUT_U8(skb, IFLA_LINKMODE, dev->link_mode); NLA_PUT_U32(skb, IFLA_MTU, dev->mtu); + NLA_PUT_U32(skb, IFLA_GROUP, dev->group); if (dev->ifindex != dev->iflink) NLA_PUT_U32(skb, IFLA_LINK, dev->iflink); @@ -1265,6 +1266,11 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, modified = 1; } + if (tb[IFLA_GROUP]) { + dev_set_group(dev, nla_get_u32(tb[IFLA_GROUP])); + modified = 1; + } + /* * Interface selected by interface index but interface * name provided implies that a name change has been |