[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:

committed by
David S. Miller

parent
eee4fe4ded
commit
5677242f43
@@ -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 = {
|
||||
|
Reference in New Issue
Block a user