diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-06-14 02:16:42 -0700 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-11-18 22:46:19 -0800 |
commit | d727abcb2355566a3372ee1810f156fba75112b7 (patch) | |
tree | ed23c68e67d158d251a8e4677e40dcd9c8fdb541 /net | |
parent | 499dcf2024092e5cce41d05599a5b51d1f92031a (diff) | |
download | linux-stable-d727abcb2355566a3372ee1810f156fba75112b7.tar.gz linux-stable-d727abcb2355566a3372ee1810f156fba75112b7.tar.bz2 linux-stable-d727abcb2355566a3372ee1810f156fba75112b7.zip |
netns: Deduplicate and fix copy_net_ns when !CONFIG_NET_NS
The copy of copy_net_ns used when the network stack is not
built is broken as it does not return -EINVAL when attempting
to create a new network namespace. We don't even have
a previous network namespace.
Since we need a copy of copy_net_ns in net/net_namespace.h that is
available when the networking stack is not built at all move the
correct version of copy_net_ns from net_namespace.c into net_namespace.h
Leaving us with just 2 versions of copy_net_ns. One version for when
we compile in network namespace suport and another stub for all other
occasions.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net_namespace.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 42f1e1c7514f..2c1c59091685 100644 --- a/net/core/net_namespace.c +++ b/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); |