aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-14 01:32:25 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 01:32:25 -0400
commit0204774191d3e7bc69e3ae6bbf328b635607505a (patch)
treeb26ac01c17f2acc3feb6b92d36564d13609e9a1f /net/dccp/ipv6.c
parent8231bd270df435f2d4d85b284dd9dbd48521dd84 (diff)
[NETNS][DCCPV6]: Move the dccp_v6_ctl_sk on the struct net.
And replace all its usage with init_net's socket. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 2ca52913f4be..109dab3550f2 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -33,8 +33,7 @@
33#include "ipv6.h" 33#include "ipv6.h"
34#include "feat.h" 34#include "feat.h"
35 35
36/* Socket used for sending RSTs and ACKs */ 36/* dccp_v6_ctl_sk is used for sending RSTs and ACKs */
37static struct sock *dccp_v6_ctl_sk;
38 37
39static struct inet_connection_sock_af_ops dccp_ipv6_mapped; 38static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
40static struct inet_connection_sock_af_ops dccp_ipv6_af_ops; 39static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
@@ -296,6 +295,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
296 struct ipv6hdr *rxip6h; 295 struct ipv6hdr *rxip6h;
297 struct sk_buff *skb; 296 struct sk_buff *skb;
298 struct flowi fl; 297 struct flowi fl;
298 struct sock *ctl_sk = init_net.dccp.v6_ctl_sk;
299 299
300 if (dccp_hdr(rxskb)->dccph_type == DCCP_PKT_RESET) 300 if (dccp_hdr(rxskb)->dccph_type == DCCP_PKT_RESET)
301 return; 301 return;
@@ -303,7 +303,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
303 if (!ipv6_unicast_destination(rxskb)) 303 if (!ipv6_unicast_destination(rxskb))
304 return; 304 return;
305 305
306 skb = dccp_ctl_make_reset(dccp_v6_ctl_sk, rxskb); 306 skb = dccp_ctl_make_reset(ctl_sk, rxskb);
307 if (skb == NULL) 307 if (skb == NULL)
308 return; 308 return;
309 309
@@ -322,9 +322,9 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
322 security_skb_classify_flow(rxskb, &fl); 322 security_skb_classify_flow(rxskb, &fl);
323 323
324 /* sk = NULL, but it is safe for now. RST socket required. */ 324 /* sk = NULL, but it is safe for now. RST socket required. */
325 if (!ip6_dst_lookup(dccp_v6_ctl_sk, &skb->dst, &fl)) { 325 if (!ip6_dst_lookup(ctl_sk, &skb->dst, &fl)) {
326 if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) { 326 if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) {
327 ip6_xmit(dccp_v6_ctl_sk, skb, &fl, NULL, 0); 327 ip6_xmit(ctl_sk, skb, &fl, NULL, 0);
328 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); 328 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
329 DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS); 329 DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS);
330 return; 330 return;
@@ -1198,7 +1198,7 @@ static int __init dccp_v6_init(void)
1198 1198
1199 inet6_register_protosw(&dccp_v6_protosw); 1199 inet6_register_protosw(&dccp_v6_protosw);
1200 1200
1201 err = inet_ctl_sock_create(&dccp_v6_ctl_sk, PF_INET6, 1201 err = inet_ctl_sock_create(&init_net.dccp.v6_ctl_sk, PF_INET6,
1202 SOCK_DCCP, IPPROTO_DCCP, &init_net); 1202 SOCK_DCCP, IPPROTO_DCCP, &init_net);
1203 if (err != 0) 1203 if (err != 0)
1204 goto out_unregister_protosw; 1204 goto out_unregister_protosw;
@@ -1210,7 +1210,7 @@ out:
1210 return err; 1210 return err;
1211 1211
1212out_destroy_ctl_sock: 1212out_destroy_ctl_sock:
1213 inet_ctl_sock_destroy(dccp_v6_ctl_sk); 1213 inet_ctl_sock_destroy(init_net.dccp.v6_ctl_sk);
1214out_unregister_protosw: 1214out_unregister_protosw:
1215 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP); 1215 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
1216 inet6_unregister_protosw(&dccp_v6_protosw); 1216 inet6_unregister_protosw(&dccp_v6_protosw);
@@ -1222,7 +1222,7 @@ out_unregister_proto:
1222static void __exit dccp_v6_exit(void) 1222static void __exit dccp_v6_exit(void)
1223{ 1223{
1224 unregister_pernet_subsys(&dccp_v6_ops); 1224 unregister_pernet_subsys(&dccp_v6_ops);
1225 inet_ctl_sock_destroy(dccp_v6_ctl_sk); 1225 inet_ctl_sock_destroy(init_net.dccp.v6_ctl_sk);
1226 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP); 1226 inet6_del_protocol(&dccp_v6_protocol, IPPROTO_DCCP);
1227 inet6_unregister_protosw(&dccp_v6_protosw); 1227 inet6_unregister_protosw(&dccp_v6_protosw);
1228 proto_unregister(&dccp_v6_prot); 1228 proto_unregister(&dccp_v6_prot);