Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78157
b: refs/heads/master
c: 4b3da70
h: refs/heads/master
i:
  78155: 10c7a67
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Jan 28, 2008
1 parent df6cf3f commit 93c9883
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 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: 97c53cacf00d1f5aa04adabfebcc806ca8b22b10
refs/heads/master: 4b3da706bbe4613d2fe4df8df4d965954ea98964
27 changes: 3 additions & 24 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,6 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
int s_idx = cb->args[0];
struct net_device *dev;

if (net != &init_net)
return 0;

idx = 0;
for_each_netdev(net, dev) {
if (idx < s_idx)
Expand Down Expand Up @@ -913,9 +910,6 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
struct nlattr *tb[IFLA_MAX+1];
char ifname[IFNAMSIZ];

if (net != &init_net)
return -EINVAL;

err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
if (err < 0)
goto errout;
Expand Down Expand Up @@ -964,9 +958,6 @@ static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
struct nlattr *tb[IFLA_MAX+1];
int err;

if (net != &init_net)
return -EINVAL;

err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
if (err < 0)
return err;
Expand Down Expand Up @@ -1048,9 +1039,6 @@ static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
struct nlattr *linkinfo[IFLA_INFO_MAX+1];
int err;

if (net != &init_net)
return -EINVAL;

#ifdef CONFIG_KMOD
replay:
#endif
Expand Down Expand Up @@ -1177,9 +1165,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
struct sk_buff *nskb;
int err;

if (net != &init_net)
return -EINVAL;

err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
if (err < 0)
return err;
Expand Down Expand Up @@ -1215,13 +1200,9 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)

static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
{
struct net *net = skb->sk->sk_net;
int idx;
int s_idx = cb->family;

if (net != &init_net)
return 0;

if (s_idx == 0)
s_idx = 1;
for (idx=1; idx<NPROTO; idx++) {
Expand All @@ -1243,6 +1224,7 @@ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)

void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
{
struct net *net = dev->nd_net;
struct sk_buff *skb;
int err = -ENOBUFS;

Expand All @@ -1257,10 +1239,10 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
kfree_skb(skb);
goto errout;
}
err = rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_KERNEL);
err = rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_KERNEL);
errout:
if (err < 0)
rtnl_set_sk_err(&init_net, RTNLGRP_LINK, err);
rtnl_set_sk_err(net, RTNLGRP_LINK, err);
}

/* Protected by RTNL sempahore. */
Expand Down Expand Up @@ -1353,9 +1335,6 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi
{
struct net_device *dev = ptr;

if (dev->nd_net != &init_net)
return NOTIFY_DONE;

switch (event) {
case NETDEV_UNREGISTER:
rtmsg_ifinfo(RTM_DELLINK, dev, ~0U);
Expand Down

0 comments on commit 93c9883

Please sign in to comment.