Netdev List
 help / color / mirror / Atom feed
* [PATCH] Update get_net_ns_by_pid
@ 2007-09-28  3:48 Eric W. Biederman
  2007-09-28 23:13 ` Serge E. Hallyn
  0 siblings, 1 reply; 2+ messages in thread
From: Eric W. Biederman @ 2007-09-28  3:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Containers, netdev


In the -mm tree the rules for access an nsproxy have changed,
and in get_net_ns_by_pid we access the nsproxy, so update
it to follow the new rules.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 739fbad..1caba10 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -746,10 +746,10 @@ static struct net *get_net_ns_by_pid(pid_t pid)
 	rcu_read_lock();
 	tsk = find_task_by_pid(pid);
 	if (tsk) {
-		task_lock(tsk);
-		if (tsk->nsproxy)
-			net = get_net(tsk->nsproxy->net_ns);
-		task_unlock(tsk);
+		struct nsproxy *nsproxy;
+		nsproxy = task_nsproxy(tsk);
+		if (nsproxy)
+			net = get_net(nsproxy->net_ns);
 	}
 	rcu_read_unlock();
 	return net;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-28 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-28  3:48 [PATCH] Update get_net_ns_by_pid Eric W. Biederman
2007-09-28 23:13 ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox