Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236556
b: refs/heads/master
c: e7ed828
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Dogaru authored and David S. Miller committed Jan 20, 2011
1 parent 3ae648f commit c17e318
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbda10fa97d72c7a1923be4426171aa90e8c6dab
refs/heads/master: e7ed828f10bd89a28f821ae7f20e691704d61923
32 changes: 28 additions & 4 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,24 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
}
EXPORT_SYMBOL(rtnl_create_link);

static int rtnl_group_changelink(struct net *net, int group,
struct ifinfomsg *ifm,
struct nlattr **tb)
{
struct net_device *dev;
int err;

for_each_netdev(net, dev) {
if (dev->group == group) {
err = do_setlink(dev, ifm, tb, NULL, 0);
if (err < 0)
return err;
}
}

return 0;
}

static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
{
struct net *net = sock_net(skb->sk);
Expand Down Expand Up @@ -1585,10 +1603,16 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
ifm = nlmsg_data(nlh);
if (ifm->ifi_index > 0)
dev = __dev_get_by_index(net, ifm->ifi_index);
else if (ifname[0])
dev = __dev_get_by_name(net, ifname);
else
dev = NULL;
else {
if (ifname[0])
dev = __dev_get_by_name(net, ifname);
else if (tb[IFLA_GROUP])
return rtnl_group_changelink(net,
nla_get_u32(tb[IFLA_GROUP]),
ifm, tb);
else
dev = NULL;
}

err = validate_linkmsg(dev, tb);
if (err < 0)
Expand Down

0 comments on commit c17e318

Please sign in to comment.