[NETNS]: Inet control socket should not hold a namespace.

This is a generic requirement, so make inet_ctl_sock_create namespace
aware and create a inet_ctl_sock_destroy wrapper around
sk_release_kernel.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Denis V. Lunev
2008-04-03 14:28:30 -07:00
committed by David S. Miller
parent eee4fe4ded
commit 5677242f43
7 changed files with 22 additions and 21 deletions

View File

@@ -2199,21 +2199,13 @@ static struct inet_protosw tcpv6_protosw = {
static int tcpv6_net_init(struct net *net)
{
int err;
struct sock *sk;
err = inet_ctl_sock_create(&sk, PF_INET6, SOCK_RAW, IPPROTO_TCP);
if (err)
return err;
net->ipv6.tcp_sk = sk;
sk_change_net(sk, net);
return err;
return inet_ctl_sock_create(&net->ipv6.tcp_sk, PF_INET6,
SOCK_RAW, IPPROTO_TCP, net);
}
static void tcpv6_net_exit(struct net *net)
{
sk_release_kernel(net->ipv6.tcp_sk);
inet_ctl_sock_destroy(net->ipv6.tcp_sk);
}
static struct pernet_operations tcpv6_net_ops = {