]> Pileus Git - ~andy/linux/commit
netns: Deduplicate and fix copy_net_ns when !CONFIG_NET_NS
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 16 Nov 2012 03:02:56 +0000 (03:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Nov 2012 01:30:55 +0000 (20:30 -0500)
commit2407dc25f741cf73853e0521ce9257531c9fc61d
tree423a867f35d847b7870edefb7d86fe63290c4613
parent75fe83c32248d99e6d5fe64155e519b78bb90481
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/net_namespace.h
net/core/net_namespace.c