aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-03 17:28:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-03 17:28:30 -0400
commit5677242f432102dea9e6eceec1dc089e2f709ca4 (patch)
tree73036437b91f2e8cd5427be48a588bff3af587eb /net/ipv6/tcp_ipv6.c
parenteee4fe4ded6e9c196168aee8f9787771f4df9c90 (diff)
[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>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2882cc51669e..378cc4002a76 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2199,21 +2199,13 @@ static struct inet_protosw tcpv6_protosw = {
2199 2199
2200static int tcpv6_net_init(struct net *net) 2200static int tcpv6_net_init(struct net *net)
2201{ 2201{
2202 int err; 2202 return inet_ctl_sock_create(&net->ipv6.tcp_sk, PF_INET6,
2203 struct sock *sk; 2203 SOCK_RAW, IPPROTO_TCP, net);
2204
2205 err = inet_ctl_sock_create(&sk, PF_INET6, SOCK_RAW, IPPROTO_TCP);
2206 if (err)
2207 return err;
2208
2209 net->ipv6.tcp_sk = sk;
2210 sk_change_net(sk, net);
2211 return err;
2212} 2204}
2213 2205
2214static void tcpv6_net_exit(struct net *net) 2206static void tcpv6_net_exit(struct net *net)
2215{ 2207{
2216 sk_release_kernel(net->ipv6.tcp_sk); 2208 inet_ctl_sock_destroy(net->ipv6.tcp_sk);
2217} 2209}
2218 2210
2219static struct pernet_operations tcpv6_net_ops = { 2211static struct pernet_operations tcpv6_net_ops = {