diff options
Diffstat (limited to 'net/dccp/input.c')
-rw-r--r-- | net/dccp/input.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c index 265985370fa1..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) |
@@ -239,7 +241,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) | |||
239 | dccp_update_gsr(sk, seqno); | 241 | dccp_update_gsr(sk, seqno); |
240 | 242 | ||
241 | if (dh->dccph_type != DCCP_PKT_SYNC && | 243 | if (dh->dccph_type != DCCP_PKT_SYNC && |
242 | (ackno != DCCP_PKT_WITHOUT_ACK_SEQ)) | 244 | ackno != DCCP_PKT_WITHOUT_ACK_SEQ && |
245 | after48(ackno, dp->dccps_gar)) | ||
243 | dp->dccps_gar = ackno; | 246 | dp->dccps_gar = ackno; |
244 | } else { | 247 | } else { |
245 | unsigned long now = jiffies; | 248 | unsigned long now = jiffies; |
@@ -257,7 +260,7 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) | |||
257 | */ | 260 | */ |
258 | if (time_before(now, (dp->dccps_rate_last + | 261 | if (time_before(now, (dp->dccps_rate_last + |
259 | sysctl_dccp_sync_ratelimit))) | 262 | sysctl_dccp_sync_ratelimit))) |
260 | return 0; | 263 | return -1; |
261 | 264 | ||
262 | DCCP_WARN("Step 6 failed for %s packet, " | 265 | DCCP_WARN("Step 6 failed for %s packet, " |
263 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " | 266 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " |
@@ -365,22 +368,13 @@ discard: | |||
365 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | 368 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, |
366 | const struct dccp_hdr *dh, const unsigned len) | 369 | const struct dccp_hdr *dh, const unsigned len) |
367 | { | 370 | { |
368 | struct dccp_sock *dp = dccp_sk(sk); | ||
369 | |||
370 | if (dccp_check_seqno(sk, skb)) | 371 | if (dccp_check_seqno(sk, skb)) |
371 | goto discard; | 372 | goto discard; |
372 | 373 | ||
373 | if (dccp_parse_options(sk, NULL, skb)) | 374 | if (dccp_parse_options(sk, NULL, skb)) |
374 | return 1; | 375 | return 1; |
375 | 376 | ||
376 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 377 | dccp_handle_ackvec_processing(sk, skb); |
377 | dccp_event_ack_recv(sk, skb); | ||
378 | |||
379 | if (dp->dccps_hc_rx_ackvec != NULL && | ||
380 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
381 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
382 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
383 | goto discard; | ||
384 | dccp_deliver_input_to_ccids(sk, skb); | 378 | dccp_deliver_input_to_ccids(sk, skb); |
385 | 379 | ||
386 | return __dccp_rcv_established(sk, skb, dh, len); | 380 | return __dccp_rcv_established(sk, skb, dh, len); |
@@ -632,15 +626,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
632 | if (dccp_parse_options(sk, NULL, skb)) | 626 | if (dccp_parse_options(sk, NULL, skb)) |
633 | return 1; | 627 | return 1; |
634 | 628 | ||
635 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 629 | dccp_handle_ackvec_processing(sk, skb); |
636 | dccp_event_ack_recv(sk, skb); | ||
637 | |||
638 | if (dp->dccps_hc_rx_ackvec != NULL && | ||
639 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
640 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
641 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
642 | goto discard; | ||
643 | |||
644 | dccp_deliver_input_to_ccids(sk, skb); | 630 | dccp_deliver_input_to_ccids(sk, skb); |
645 | } | 631 | } |
646 | 632 | ||