[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>
This commit is contained in:
Denis V. Lunev
2008-04-03 14:20:52 -07:00
committed by David S. Miller
parent 14c0c8e8e0
commit 7630f02681
4 changed files with 19 additions and 15 deletions

View File

@@ -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: