Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 15 Jun 2011 17:58:10 +0400
From: Vasiliy Kulikov <segoon@...nwall.com>
To: linux-kernel@...r.kernel.org
Cc: kernel-hardening@...ts.openwall.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	"David S. Miller" <davem@...emloft.net>,
	Arnd Bergmann <arnd@...db.de>,
	"Eric W. Biederman" <ebiederm@...ssion.com> ,
	Daniel Lezcano <daniel.lezcano@...e.fr> ,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com> ,
	Stephen Rothwell <sfr@...b.auug.org.au> ,
	netdev@...r.kernel.org
Subject: [RFC 3/5 v3] net: restore net_create and make it globally visible

This reverts commit 911cb193f3eb0370f20fbba712211e55ffede4de and
makes net_create() globally visible.  net_create() will be needed
for fake_net in fs/proc/proc_net.c. 

Signed-off-by: Vasiliy Kulikov <segoon@...nwall.com>
---
 include/net/net_namespace.h |    2 ++
 net/core/net_namespace.c    |   12 ++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 2bf9ed9..5d5328c 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -116,6 +116,8 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
 }
 #endif /* CONFIG_NET */
 
+extern struct net *net_create(void);
+
 
 extern struct list_head net_namespace_list;
 
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 6c6b86d..c90f0db 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -210,14 +210,11 @@ static void net_free(struct net *net)
 	kmem_cache_free(net_cachep, net);
 }
 
-struct net *copy_net_ns(unsigned long flags, struct net *old_net)
+struct net *net_create(void)
 {
 	struct net *net;
 	int rv;
 
-	if (!(flags & CLONE_NEWNET))
-		return get_net(old_net);
-
 	net = net_alloc();
 	if (!net)
 		return ERR_PTR(-ENOMEM);
@@ -236,6 +233,13 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net)
 	return net;
 }
 
+struct net *copy_net_ns(unsigned long flags, struct net *old_net)
+{
+	if (!(flags & CLONE_NEWNET))
+		return get_net(old_net);
+	return net_create();
+}
+
 static DEFINE_SPINLOCK(cleanup_list_lock);
 static LIST_HEAD(cleanup_list);  /* Must hold cleanup_list_lock to touch */
 
-- 
1.7.0.4

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.