From cdb658b4ffe266c2316e90c6968f2833a2d24920 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Thu, 14 Jun 2012 02:16:42 -0700 Subject: [PATCH] --- yaml --- r: 346301 b: refs/heads/master c: d727abcb2355566a3372ee1810f156fba75112b7 h: refs/heads/master i: 346299: d5c601c30026a29b9a42d99c4176723f117e02db v: v3 --- [refs] | 2 +- trunk/include/net/net_namespace.h | 15 +++++++++------ trunk/net/core/net_namespace.c | 7 ------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 9a359a53ca64..ddd806e2bbcd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 499dcf2024092e5cce41d05599a5b51d1f92031a +refs/heads/master: d727abcb2355566a3372ee1810f156fba75112b7 diff --git a/trunk/include/net/net_namespace.h b/trunk/include/net/net_namespace.h index 95e646641184..32dcb6085ebe 100644 --- a/trunk/include/net/net_namespace.h +++ b/trunk/include/net/net_namespace.h @@ -126,16 +126,19 @@ struct net { /* Init's network namespace */ extern struct net init_net; -#ifdef CONFIG_NET +#ifdef CONFIG_NET_NS extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); -#else /* CONFIG_NET */ -static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) +#else /* CONFIG_NET_NS */ +#include +#include +static inline struct net *copy_net_ns(unsigned long flags, struct net *old_net) { - /* There is nothing to copy so this is a noop */ - return net_ns; + if (flags & CLONE_NEWNET) + return ERR_PTR(-EINVAL); + return old_net; } -#endif /* CONFIG_NET */ +#endif /* CONFIG_NET_NS */ extern struct list_head net_namespace_list; diff --git a/trunk/net/core/net_namespace.c b/trunk/net/core/net_namespace.c index 42f1e1c7514f..2c1c59091685 100644 --- a/trunk/net/core/net_namespace.c +++ b/trunk/net/core/net_namespace.c @@ -347,13 +347,6 @@ struct net *get_net_ns_by_fd(int fd) } #else -struct net *copy_net_ns(unsigned long flags, struct net *old_net) -{ - if (flags & CLONE_NEWNET) - return ERR_PTR(-EINVAL); - return old_net; -} - struct net *get_net_ns_by_fd(int fd) { return ERR_PTR(-EINVAL);