diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-03 17:20:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-03 17:20:52 -0400 |
commit | 7630f026810a63464e47391ab1e03674c33eb1b8 (patch) | |
tree | 05ff3b2f6a750e659de4484c4b825953ecce1659 /net/dccp/ipv4.c | |
parent | 14c0c8e8e0fb85e7a57e88606c009377746b39d9 (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/ipv4.c')
-rw-r--r-- | net/dccp/ipv4.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 @@ | |||
36 | * the Out-of-the-blue (OOTB) packets. A control sock will be created | 36 | * the Out-of-the-blue (OOTB) packets. A control sock will be created |
37 | * for this socket at the initialization time. | 37 | * for this socket at the initialization time. |
38 | */ | 38 | */ |
39 | static struct socket *dccp_v4_ctl_socket; | 39 | static struct sock *dccp_v4_ctl_sk; |
40 | 40 | ||
41 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | 41 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) |
42 | { | 42 | { |
@@ -514,11 +514,11 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | |||
514 | if (rxskb->rtable->rt_type != RTN_LOCAL) | 514 | if (rxskb->rtable->rt_type != RTN_LOCAL) |
515 | return; | 515 | return; |
516 | 516 | ||
517 | dst = dccp_v4_route_skb(dccp_v4_ctl_socket->sk, rxskb); | 517 | dst = dccp_v4_route_skb(dccp_v4_ctl_sk, rxskb); |
518 | if (dst == NULL) | 518 | if (dst == NULL) |
519 | return; | 519 | return; |
520 | 520 | ||
521 | skb = dccp_ctl_make_reset(dccp_v4_ctl_socket, rxskb); | 521 | skb = dccp_ctl_make_reset(dccp_v4_ctl_sk, rxskb); |
522 | if (skb == NULL) | 522 | if (skb == NULL) |
523 | goto out; | 523 | goto out; |
524 | 524 | ||
@@ -527,10 +527,10 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | |||
527 | rxiph->daddr); | 527 | rxiph->daddr); |
528 | skb->dst = dst_clone(dst); | 528 | skb->dst = dst_clone(dst); |
529 | 529 | ||
530 | bh_lock_sock(dccp_v4_ctl_socket->sk); | 530 | bh_lock_sock(dccp_v4_ctl_sk); |
531 | err = ip_build_and_send_pkt(skb, dccp_v4_ctl_socket->sk, | 531 | err = ip_build_and_send_pkt(skb, dccp_v4_ctl_sk, |
532 | rxiph->daddr, rxiph->saddr, NULL); | 532 | rxiph->daddr, rxiph->saddr, NULL); |
533 | bh_unlock_sock(dccp_v4_ctl_socket->sk); | 533 | bh_unlock_sock(dccp_v4_ctl_sk); |
534 | 534 | ||
535 | if (net_xmit_eval(err) == 0) { | 535 | if (net_xmit_eval(err) == 0) { |
536 | DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); | 536 | DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); |
@@ -991,6 +991,7 @@ static struct inet_protosw dccp_v4_protosw = { | |||
991 | 991 | ||
992 | static int __init dccp_v4_init(void) | 992 | static int __init dccp_v4_init(void) |
993 | { | 993 | { |
994 | struct socket *socket; | ||
994 | int err = proto_register(&dccp_v4_prot, 1); | 995 | int err = proto_register(&dccp_v4_prot, 1); |
995 | 996 | ||
996 | if (err != 0) | 997 | if (err != 0) |
@@ -1002,10 +1003,11 @@ static int __init dccp_v4_init(void) | |||
1002 | 1003 | ||
1003 | inet_register_protosw(&dccp_v4_protosw); | 1004 | inet_register_protosw(&dccp_v4_protosw); |
1004 | 1005 | ||
1005 | err = inet_csk_ctl_sock_create(&dccp_v4_ctl_socket, PF_INET, | 1006 | err = inet_csk_ctl_sock_create(&socket, PF_INET, |
1006 | SOCK_DCCP, IPPROTO_DCCP); | 1007 | SOCK_DCCP, IPPROTO_DCCP); |
1007 | if (err) | 1008 | if (err) |
1008 | goto out_unregister_protosw; | 1009 | goto out_unregister_protosw; |
1010 | dccp_v4_ctl_sk = socket->sk; | ||
1009 | out: | 1011 | out: |
1010 | return err; | 1012 | return err; |
1011 | out_unregister_protosw: | 1013 | out_unregister_protosw: |