aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c16
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 */
39static struct socket *dccp_v4_ctl_socket; 39static struct sock *dccp_v4_ctl_sk;
40 40
41int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) 41int 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
992static int __init dccp_v4_init(void) 992static 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;
1009out: 1011out:
1010 return err; 1012 return err;
1011out_unregister_protosw: 1013out_unregister_protosw: