diff options
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r-- | net/dccp/ipv6.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 9c6d0508e63a..4663a01d5039 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -668,7 +668,7 @@ static int dccp_v6_rcv(struct sk_buff *skb) | |||
668 | DCCP_SKB_CB(skb)->dccpd_ack_seq = dccp_hdr_ack_seq(skb); | 668 | DCCP_SKB_CB(skb)->dccpd_ack_seq = dccp_hdr_ack_seq(skb); |
669 | 669 | ||
670 | lookup: | 670 | lookup: |
671 | sk = __inet6_lookup_skb(&dccp_hashinfo, skb, | 671 | sk = __inet6_lookup_skb(&dccp_hashinfo, skb, __dccp_hdr_len(dh), |
672 | dh->dccph_sport, dh->dccph_dport, | 672 | dh->dccph_sport, dh->dccph_dport, |
673 | inet6_iif(skb)); | 673 | inet6_iif(skb)); |
674 | if (!sk) { | 674 | if (!sk) { |
@@ -691,26 +691,26 @@ lookup: | |||
691 | 691 | ||
692 | if (sk->sk_state == DCCP_NEW_SYN_RECV) { | 692 | if (sk->sk_state == DCCP_NEW_SYN_RECV) { |
693 | struct request_sock *req = inet_reqsk(sk); | 693 | struct request_sock *req = inet_reqsk(sk); |
694 | struct sock *nsk = NULL; | 694 | struct sock *nsk; |
695 | 695 | ||
696 | sk = req->rsk_listener; | 696 | sk = req->rsk_listener; |
697 | if (likely(sk->sk_state == DCCP_LISTEN)) { | 697 | if (unlikely(sk->sk_state != DCCP_LISTEN)) { |
698 | nsk = dccp_check_req(sk, skb, req); | ||
699 | } else { | ||
700 | inet_csk_reqsk_queue_drop_and_put(sk, req); | 698 | inet_csk_reqsk_queue_drop_and_put(sk, req); |
701 | goto lookup; | 699 | goto lookup; |
702 | } | 700 | } |
701 | sock_hold(sk); | ||
702 | nsk = dccp_check_req(sk, skb, req); | ||
703 | if (!nsk) { | 703 | if (!nsk) { |
704 | reqsk_put(req); | 704 | reqsk_put(req); |
705 | goto discard_it; | 705 | goto discard_and_relse; |
706 | } | 706 | } |
707 | if (nsk == sk) { | 707 | if (nsk == sk) { |
708 | sock_hold(sk); | ||
709 | reqsk_put(req); | 708 | reqsk_put(req); |
710 | } else if (dccp_child_process(sk, nsk, skb)) { | 709 | } else if (dccp_child_process(sk, nsk, skb)) { |
711 | dccp_v6_ctl_send_reset(sk, skb); | 710 | dccp_v6_ctl_send_reset(sk, skb); |
712 | goto discard_it; | 711 | goto discard_and_relse; |
713 | } else { | 712 | } else { |
713 | sock_put(sk); | ||
714 | return 0; | 714 | return 0; |
715 | } | 715 | } |
716 | } | 716 | } |
@@ -993,7 +993,7 @@ static struct proto dccp_v6_prot = { | |||
993 | .sendmsg = dccp_sendmsg, | 993 | .sendmsg = dccp_sendmsg, |
994 | .recvmsg = dccp_recvmsg, | 994 | .recvmsg = dccp_recvmsg, |
995 | .backlog_rcv = dccp_v6_do_rcv, | 995 | .backlog_rcv = dccp_v6_do_rcv, |
996 | .hash = inet_hash, | 996 | .hash = inet6_hash, |
997 | .unhash = inet_unhash, | 997 | .unhash = inet_unhash, |
998 | .accept = inet_csk_accept, | 998 | .accept = inet_csk_accept, |
999 | .get_port = inet_csk_get_port, | 999 | .get_port = inet_csk_get_port, |