From 7630f026810a63464e47391ab1e03674c33eb1b8 Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Thu, 3 Apr 2008 14:20:52 -0700 Subject: [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 Acked-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- net/dccp/ipv6.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'net/dccp/ipv6.c') diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index ea3f3264861..44e8b332317 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -34,7 +34,7 @@ #include "feat.h" /* Socket used for sending RSTs and ACKs */ -static struct socket *dccp_v6_ctl_socket; +static struct sock *dccp_v6_ctl_sk; static struct inet_connection_sock_af_ops dccp_ipv6_mapped; static 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) if (!ipv6_unicast_destination(rxskb)) return; - skb = dccp_ctl_make_reset(dccp_v6_ctl_socket, rxskb); + skb = dccp_ctl_make_reset(dccp_v6_ctl_sk, rxskb); if (skb == NULL) return; @@ -324,7 +324,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) /* sk = NULL, but it is safe for now. RST socket required. */ if (!ip6_dst_lookup(NULL, &skb->dst, &fl)) { if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(dccp_v6_ctl_socket->sk, skb, &fl, NULL, 0); + ip6_xmit(dccp_v6_ctl_sk, skb, &fl, NULL, 0); DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS); return; @@ -1173,6 +1173,7 @@ static struct inet_protosw dccp_v6_protosw = { static int __init dccp_v6_init(void) { + struct socket *socket; int err = proto_register(&dccp_v6_prot, 1); if (err != 0) @@ -1184,10 +1185,11 @@ static int __init dccp_v6_init(void) inet6_register_protosw(&dccp_v6_protosw); - err = inet_csk_ctl_sock_create(&dccp_v6_ctl_socket, PF_INET6, + err = inet_csk_ctl_sock_create(&socket, PF_INET6, SOCK_DCCP, IPPROTO_DCCP); if (err != 0) goto out_unregister_protosw; + dccp_v6_ctl_sk = socket->sk; out: return err; out_unregister_protosw: -- cgit v1.2.3