diff options
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index d78030f88bd0..b44775f9f2bf 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/security.h> | 35 | #include <linux/security.h> |
36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
37 | #include <linux/if_addr.h> | 37 | #include <linux/if_addr.h> |
38 | #include <linux/nsproxy.h> | ||
39 | 38 | ||
40 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
41 | #include <asm/system.h> | 40 | #include <asm/system.h> |
@@ -52,6 +51,7 @@ | |||
52 | #include <net/pkt_sched.h> | 51 | #include <net/pkt_sched.h> |
53 | #include <net/fib_rules.h> | 52 | #include <net/fib_rules.h> |
54 | #include <net/rtnetlink.h> | 53 | #include <net/rtnetlink.h> |
54 | #include <net/net_namespace.h> | ||
55 | 55 | ||
56 | struct rtnl_link | 56 | struct rtnl_link |
57 | { | 57 | { |
@@ -725,25 +725,6 @@ static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = { | |||
725 | [IFLA_INFO_DATA] = { .type = NLA_NESTED }, | 725 | [IFLA_INFO_DATA] = { .type = NLA_NESTED }, |
726 | }; | 726 | }; |
727 | 727 | ||
728 | static struct net *get_net_ns_by_pid(pid_t pid) | ||
729 | { | ||
730 | struct task_struct *tsk; | ||
731 | struct net *net; | ||
732 | |||
733 | /* Lookup the network namespace */ | ||
734 | net = ERR_PTR(-ESRCH); | ||
735 | rcu_read_lock(); | ||
736 | tsk = find_task_by_vpid(pid); | ||
737 | if (tsk) { | ||
738 | struct nsproxy *nsproxy; | ||
739 | nsproxy = task_nsproxy(tsk); | ||
740 | if (nsproxy) | ||
741 | net = get_net(nsproxy->net_ns); | ||
742 | } | ||
743 | rcu_read_unlock(); | ||
744 | return net; | ||
745 | } | ||
746 | |||
747 | static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[]) | 728 | static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[]) |
748 | { | 729 | { |
749 | if (dev) { | 730 | if (dev) { |