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/ipv4.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'net/dccp/ipv4.c') diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 7d62f7eb6134..f97049bf22c0 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -36,7 +36,7 @@ * the Out-of-the-blue (OOTB) packets. A control sock will be created * for this socket at the initialization time. */ -static struct socket *dccp_v4_ctl_socket; +static struct sock *dccp_v4_ctl_sk; int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { @@ -514,11 +514,11 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) if (rxskb->rtable->rt_type != RTN_LOCAL) return; - dst = dccp_v4_route_skb(dccp_v4_ctl_socket->sk, rxskb); + dst = dccp_v4_route_skb(dccp_v4_ctl_sk, rxskb); if (dst == NULL) return; - skb = dccp_ctl_make_reset(dccp_v4_ctl_socket, rxskb); + skb = dccp_ctl_make_reset(dccp_v4_ctl_sk, rxskb); if (skb == NULL) goto out; @@ -527,10 +527,10 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) rxiph->daddr); skb->dst = dst_clone(dst); - bh_lock_sock(dccp_v4_ctl_socket->sk); - err = ip_build_and_send_pkt(skb, dccp_v4_ctl_socket->sk, + bh_lock_sock(dccp_v4_ctl_sk); + err = ip_build_and_send_pkt(skb, dccp_v4_ctl_sk, rxiph->daddr, rxiph->saddr, NULL); - bh_unlock_sock(dccp_v4_ctl_socket->sk); + bh_unlock_sock(dccp_v4_ctl_sk); if (net_xmit_eval(err) == 0) { DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); @@ -991,6 +991,7 @@ static struct inet_protosw dccp_v4_protosw = { static int __init dccp_v4_init(void) { + struct socket *socket; int err = proto_register(&dccp_v4_prot, 1); if (err != 0) @@ -1002,10 +1003,11 @@ static int __init dccp_v4_init(void) inet_register_protosw(&dccp_v4_protosw); - err = inet_csk_ctl_sock_create(&dccp_v4_ctl_socket, PF_INET, + err = inet_csk_ctl_sock_create(&socket, PF_INET, SOCK_DCCP, IPPROTO_DCCP); if (err) goto out_unregister_protosw; + dccp_v4_ctl_sk = socket->sk; out: return err; out_unregister_protosw: -- cgit v1.2.3-59-g8ed1b