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.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 5684e14932bd..9c67a961ba53 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -204,8 +204,6 @@ void dccp_req_err(struct sock *sk, u64 seq)
204 * ICMPs are not backlogged, hence we cannot get an established 204 * ICMPs are not backlogged, hence we cannot get an established
205 * socket here. 205 * socket here.
206 */ 206 */
207 WARN_ON(req->sk);
208
209 if (!between48(seq, dccp_rsk(req)->dreq_iss, dccp_rsk(req)->dreq_gss)) { 207 if (!between48(seq, dccp_rsk(req)->dreq_iss, dccp_rsk(req)->dreq_gss)) {
210 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); 208 NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
211 } else { 209 } else {
@@ -802,7 +800,7 @@ static int dccp_v4_rcv(struct sk_buff *skb)
802 } 800 }
803 801
804lookup: 802lookup:
805 sk = __inet_lookup_skb(&dccp_hashinfo, skb, 803 sk = __inet_lookup_skb(&dccp_hashinfo, skb, __dccp_hdr_len(dh),
806 dh->dccph_sport, dh->dccph_dport); 804 dh->dccph_sport, dh->dccph_dport);
807 if (!sk) { 805 if (!sk) {
808 dccp_pr_debug("failed to look up flow ID in table and " 806 dccp_pr_debug("failed to look up flow ID in table and "
@@ -824,26 +822,26 @@ lookup:
824 822
825 if (sk->sk_state == DCCP_NEW_SYN_RECV) { 823 if (sk->sk_state == DCCP_NEW_SYN_RECV) {
826 struct request_sock *req = inet_reqsk(sk); 824 struct request_sock *req = inet_reqsk(sk);
827 struct sock *nsk = NULL; 825 struct sock *nsk;
828 826
829 sk = req->rsk_listener; 827 sk = req->rsk_listener;
830 if (likely(sk->sk_state == DCCP_LISTEN)) { 828 if (unlikely(sk->sk_state != DCCP_LISTEN)) {
831 nsk = dccp_check_req(sk, skb, req);
832 } else {
833 inet_csk_reqsk_queue_drop_and_put(sk, req); 829 inet_csk_reqsk_queue_drop_and_put(sk, req);
834 goto lookup; 830 goto lookup;
835 } 831 }
832 sock_hold(sk);
833 nsk = dccp_check_req(sk, skb, req);
836 if (!nsk) { 834 if (!nsk) {
837 reqsk_put(req); 835 reqsk_put(req);
838 goto discard_it; 836 goto discard_and_relse;
839 } 837 }
840 if (nsk == sk) { 838 if (nsk == sk) {
841 sock_hold(sk);
842 reqsk_put(req); 839 reqsk_put(req);
843 } else if (dccp_child_process(sk, nsk, skb)) { 840 } else if (dccp_child_process(sk, nsk, skb)) {
844 dccp_v4_ctl_send_reset(sk, skb); 841 dccp_v4_ctl_send_reset(sk, skb);
845 goto discard_it; 842 goto discard_and_relse;
846 } else { 843 } else {
844 sock_put(sk);
847 return 0; 845 return 0;
848 } 846 }
849 } 847 }