aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-01-27 10:55:21 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-28 18:32:55 -0500
commit556e6256c813063b95a9f4e55109f77c1a7d3fdd (patch)
treee607bbf12fedcaba7c48f1ea8e12ce8afbf012d2 /net/core/netpoll.c
parentfaeed828f9607923e9dc22182e819908e95c8852 (diff)
netpoll: use the net namespace of current process instead of init_net
This will allow us to setup netconsole in a different namespace rather than where init_net is. Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index a6f39b6aeec0..331ccb90f915 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -1049,8 +1049,10 @@ int netpoll_setup(struct netpoll *np)
1049 int err; 1049 int err;
1050 1050
1051 rtnl_lock(); 1051 rtnl_lock();
1052 if (np->dev_name) 1052 if (np->dev_name) {
1053 ndev = __dev_get_by_name(&init_net, np->dev_name); 1053 struct net *net = current->nsproxy->net_ns;
1054 ndev = __dev_get_by_name(net, np->dev_name);
1055 }
1054 if (!ndev) { 1056 if (!ndev) {
1055 np_err(np, "%s doesn't exist, aborting\n", np->dev_name); 1057 np_err(np, "%s doesn't exist, aborting\n", np->dev_name);
1056 err = -ENODEV; 1058 err = -ENODEV;