aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-03 17:20:52 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-03 17:20:52 -0400
commit7630f026810a63464e47391ab1e03674c33eb1b8 (patch)
tree05ff3b2f6a750e659de4484c4b825953ecce1659 /net/dccp/ipv6.c
parent14c0c8e8e0fb85e7a57e88606c009377746b39d9 (diff)
[DCCP]: Replace socket with sock for reset sending.
Replace dccp_v(4|6)_ctl_socket with sock to unify a code with TCP/ICMP. 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/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index ea3f32648618..44e8b3323170 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -34,7 +34,7 @@
34#include "feat.h" 34#include "feat.h"
35 35
36/* Socket used for sending RSTs and ACKs */ 36/* Socket used for sending RSTs and ACKs */
37static struct socket *dccp_v6_ctl_socket; 37static struct sock *dccp_v6_ctl_sk;
38 38
39static struct inet_connection_sock_af_ops dccp_ipv6_mapped; 39static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
40static struct inet_connection_sock_af_ops dccp_ipv6_af_ops; 40static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
@@ -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_socket, rxskb); 306 skb = dccp_ctl_make_reset(dccp_v6_ctl_sk, rxskb);
307 if (skb == NULL) 307 if (skb == NULL)
308 return; 308 return;
309 309
@@ -324,7 +324,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
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(NULL, &skb->dst, &fl)) { 325 if (!ip6_dst_lookup(NULL, &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_socket->sk, skb, &fl, NULL, 0); 327 ip6_xmit(dccp_v6_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;
@@ -1173,6 +1173,7 @@ static struct inet_protosw dccp_v6_protosw = {
1173 1173
1174static int __init dccp_v6_init(void) 1174static int __init dccp_v6_init(void)
1175{ 1175{
1176 struct socket *socket;
1176 int err = proto_register(&dccp_v6_prot, 1); 1177 int err = proto_register(&dccp_v6_prot, 1);
1177 1178
1178 if (err != 0) 1179 if (err != 0)
@@ -1184,10 +1185,11 @@ static int __init dccp_v6_init(void)
1184 1185
1185 inet6_register_protosw(&dccp_v6_protosw); 1186 inet6_register_protosw(&dccp_v6_protosw);
1186 1187
1187 err = inet_csk_ctl_sock_create(&dccp_v6_ctl_socket, PF_INET6, 1188 err = inet_csk_ctl_sock_create(&socket, PF_INET6,
1188 SOCK_DCCP, IPPROTO_DCCP); 1189 SOCK_DCCP, IPPROTO_DCCP);
1189 if (err != 0) 1190 if (err != 0)
1190 goto out_unregister_protosw; 1191 goto out_unregister_protosw;
1192 dccp_v6_ctl_sk = socket->sk;
1191out: 1193out:
1192 return err; 1194 return err;
1193out_unregister_protosw: 1195out_unregister_protosw: