Skip to content

Commit

Permalink
[DCCP] ACKVEC: fix ackvector length calculation
Browse files Browse the repository at this point in the history
Fix ackvector length calculation upon receiving an "ack-of-ack".  This
patch avoids the ackvector from growing too large which causes it to
not be inserted into packets.

Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrea Bittau authored and David S. Miller committed Sep 22, 2006
1 parent a1e59ab commit 23d06e3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions net/dccp/ackvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,13 @@ static void dccp_ackvec_throw_record(struct dccp_ackvec *av,
{
struct dccp_ackvec_record *next;

av->dccpav_buf_tail = avr->dccpavr_ack_ptr - 1;
if (av->dccpav_buf_tail == 0)
av->dccpav_buf_tail = DCCP_MAX_ACKVEC_LEN - 1;

av->dccpav_vec_len -= avr->dccpavr_sent_len;
/* sort out vector length */
if (av->dccpav_buf_head <= avr->dccpavr_ack_ptr)
av->dccpav_vec_len = avr->dccpavr_ack_ptr - av->dccpav_buf_head;
else
av->dccpav_vec_len = DCCP_MAX_ACKVEC_LEN - 1
- av->dccpav_buf_head
+ avr->dccpavr_ack_ptr;

/* free records */
list_for_each_entry_safe_from(avr, next, &av->dccpav_records,
Expand Down

0 comments on commit 23d06e3

Please sign in to comment.