diff options
Diffstat (limited to 'net/dccp/input.c')
-rw-r--r-- | net/dccp/input.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c index e424a09e83f6..8cde009e8b85 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -160,13 +160,15 @@ static void dccp_rcv_reset(struct sock *sk, struct sk_buff *skb) | |||
160 | dccp_time_wait(sk, DCCP_TIME_WAIT, 0); | 160 | dccp_time_wait(sk, DCCP_TIME_WAIT, 0); |
161 | } | 161 | } |
162 | 162 | ||
163 | static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) | 163 | static void dccp_handle_ackvec_processing(struct sock *sk, struct sk_buff *skb) |
164 | { | 164 | { |
165 | struct dccp_sock *dp = dccp_sk(sk); | 165 | struct dccp_ackvec *av = dccp_sk(sk)->dccps_hc_rx_ackvec; |
166 | 166 | ||
167 | if (dp->dccps_hc_rx_ackvec != NULL) | 167 | if (av == NULL) |
168 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, | 168 | return; |
169 | DCCP_SKB_CB(skb)->dccpd_ack_seq); | 169 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
170 | dccp_ackvec_clear_state(av, DCCP_SKB_CB(skb)->dccpd_ack_seq); | ||
171 | dccp_ackvec_input(av, skb); | ||
170 | } | 172 | } |
171 | 173 | ||
172 | static void dccp_deliver_input_to_ccids(struct sock *sk, struct sk_buff *skb) | 174 | static void dccp_deliver_input_to_ccids(struct sock *sk, struct sk_buff *skb) |
@@ -258,7 +260,7 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) | |||
258 | */ | 260 | */ |
259 | if (time_before(now, (dp->dccps_rate_last + | 261 | if (time_before(now, (dp->dccps_rate_last + |
260 | sysctl_dccp_sync_ratelimit))) | 262 | sysctl_dccp_sync_ratelimit))) |
261 | return 0; | 263 | return -1; |
262 | 264 | ||
263 | DCCP_WARN("Step 6 failed for %s packet, " | 265 | DCCP_WARN("Step 6 failed for %s packet, " |
264 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " | 266 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " |
@@ -366,22 +368,13 @@ discard: | |||
366 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | 368 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, |
367 | const struct dccp_hdr *dh, const unsigned len) | 369 | const struct dccp_hdr *dh, const unsigned len) |
368 | { | 370 | { |
369 | struct dccp_sock *dp = dccp_sk(sk); | ||
370 | |||
371 | if (dccp_check_seqno(sk, skb)) | 371 | if (dccp_check_seqno(sk, skb)) |
372 | goto discard; | 372 | goto discard; |
373 | 373 | ||
374 | if (dccp_parse_options(sk, NULL, skb)) | 374 | if (dccp_parse_options(sk, NULL, skb)) |
375 | return 1; | 375 | return 1; |
376 | 376 | ||
377 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 377 | dccp_handle_ackvec_processing(sk, skb); |
378 | dccp_event_ack_recv(sk, skb); | ||
379 | |||
380 | if (dp->dccps_hc_rx_ackvec != NULL && | ||
381 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
382 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
383 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
384 | goto discard; | ||
385 | dccp_deliver_input_to_ccids(sk, skb); | 378 | dccp_deliver_input_to_ccids(sk, skb); |
386 | 379 | ||
387 | return __dccp_rcv_established(sk, skb, dh, len); | 380 | return __dccp_rcv_established(sk, skb, dh, len); |
@@ -633,15 +626,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
633 | if (dccp_parse_options(sk, NULL, skb)) | 626 | if (dccp_parse_options(sk, NULL, skb)) |
634 | return 1; | 627 | return 1; |
635 | 628 | ||
636 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 629 | dccp_handle_ackvec_processing(sk, skb); |
637 | dccp_event_ack_recv(sk, skb); | ||
638 | |||
639 | if (dp->dccps_hc_rx_ackvec != NULL && | ||
640 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
641 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
642 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
643 | goto discard; | ||
644 | |||
645 | dccp_deliver_input_to_ccids(sk, skb); | 630 | dccp_deliver_input_to_ccids(sk, skb); |
646 | } | 631 | } |
647 | 632 | ||