diff options
Diffstat (limited to 'net/dccp/ackvec.c')
| -rw-r--r-- | net/dccp/ackvec.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index 8c211c58893b..4d176d33983f 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c | |||
| @@ -142,14 +142,13 @@ struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority) | |||
| 142 | struct dccp_ackvec *av = kmem_cache_alloc(dccp_ackvec_slab, priority); | 142 | struct dccp_ackvec *av = kmem_cache_alloc(dccp_ackvec_slab, priority); |
| 143 | 143 | ||
| 144 | if (av != NULL) { | 144 | if (av != NULL) { |
| 145 | av->dccpav_buf_head = | 145 | av->dccpav_buf_head = DCCP_MAX_ACKVEC_LEN - 1; |
| 146 | av->dccpav_buf_tail = DCCP_MAX_ACKVEC_LEN - 1; | ||
| 147 | av->dccpav_buf_ackno = DCCP_MAX_SEQNO + 1; | 146 | av->dccpav_buf_ackno = DCCP_MAX_SEQNO + 1; |
| 148 | av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0; | 147 | av->dccpav_buf_nonce = av->dccpav_buf_nonce = 0; |
| 149 | av->dccpav_ack_ptr = 0; | 148 | av->dccpav_ack_ptr = 0; |
| 150 | av->dccpav_time.tv_sec = 0; | 149 | av->dccpav_time.tv_sec = 0; |
| 151 | av->dccpav_time.tv_usec = 0; | 150 | av->dccpav_time.tv_usec = 0; |
| 152 | av->dccpav_sent_len = av->dccpav_vec_len = 0; | 151 | av->dccpav_vec_len = 0; |
| 153 | INIT_LIST_HEAD(&av->dccpav_records); | 152 | INIT_LIST_HEAD(&av->dccpav_records); |
| 154 | } | 153 | } |
| 155 | 154 | ||
| @@ -353,11 +352,13 @@ static void dccp_ackvec_throw_record(struct dccp_ackvec *av, | |||
| 353 | { | 352 | { |
| 354 | struct dccp_ackvec_record *next; | 353 | struct dccp_ackvec_record *next; |
| 355 | 354 | ||
| 356 | av->dccpav_buf_tail = avr->dccpavr_ack_ptr - 1; | 355 | /* sort out vector length */ |
| 357 | if (av->dccpav_buf_tail == 0) | 356 | if (av->dccpav_buf_head <= avr->dccpavr_ack_ptr) |
| 358 | av->dccpav_buf_tail = DCCP_MAX_ACKVEC_LEN - 1; | 357 | av->dccpav_vec_len = avr->dccpavr_ack_ptr - av->dccpav_buf_head; |
| 359 | 358 | else | |
| 360 | av->dccpav_vec_len -= avr->dccpavr_sent_len; | 359 | av->dccpav_vec_len = DCCP_MAX_ACKVEC_LEN - 1 |
| 360 | - av->dccpav_buf_head | ||
| 361 | + avr->dccpavr_ack_ptr; | ||
| 361 | 362 | ||
| 362 | /* free records */ | 363 | /* free records */ |
| 363 | list_for_each_entry_safe_from(avr, next, &av->dccpav_records, | 364 | list_for_each_entry_safe_from(avr, next, &av->dccpav_records, |
| @@ -434,8 +435,7 @@ static void dccp_ackvec_check_rcv_ackvector(struct dccp_ackvec *av, | |||
| 434 | break; | 435 | break; |
| 435 | found: | 436 | found: |
| 436 | if (between48(avr->dccpavr_ack_seqno, ackno_end_rl, ackno)) { | 437 | if (between48(avr->dccpavr_ack_seqno, ackno_end_rl, ackno)) { |
| 437 | const u8 state = (*vector & | 438 | const u8 state = *vector & DCCP_ACKVEC_STATE_MASK; |
| 438 | DCCP_ACKVEC_STATE_MASK) >> 6; | ||
| 439 | if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED) { | 439 | if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED) { |
| 440 | #ifdef CONFIG_IP_DCCP_DEBUG | 440 | #ifdef CONFIG_IP_DCCP_DEBUG |
| 441 | struct dccp_sock *dp = dccp_sk(sk); | 441 | struct dccp_sock *dp = dccp_sk(sk); |
