aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ackvec.c
diff options
context:
space:
mode:
authorAndrea Bittau <a.bittau@cs.ucl.ac.uk>2006-09-19 16:04:54 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:19:07 -0400
commit23d06e3b986677ec57007a24891fa9deb09ac973 (patch)
treef77c083196ebd447fdf5905a984d2235695c62e3 /net/dccp/ackvec.c
parenta1e59abf824969554b90facd44a4ab16e265afa4 (diff)
[DCCP] ACKVEC: fix ackvector length calculation
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>
Diffstat (limited to 'net/dccp/ackvec.c')
-rw-r--r--net/dccp/ackvec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index 8c211c58893b..8dab723cc704 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -353,11 +353,13 @@ static void dccp_ackvec_throw_record(struct dccp_ackvec *av,
353{ 353{
354 struct dccp_ackvec_record *next; 354 struct dccp_ackvec_record *next;
355 355
356 av->dccpav_buf_tail = avr->dccpavr_ack_ptr - 1; 356 /* sort out vector length */
357 if (av->dccpav_buf_tail == 0) 357 if (av->dccpav_buf_head <= avr->dccpavr_ack_ptr)
358 av->dccpav_buf_tail = DCCP_MAX_ACKVEC_LEN - 1; 358 av->dccpav_vec_len = avr->dccpavr_ack_ptr - av->dccpav_buf_head;
359 359 else
360 av->dccpav_vec_len -= avr->dccpavr_sent_len; 360 av->dccpav_vec_len = DCCP_MAX_ACKVEC_LEN - 1
361 - av->dccpav_buf_head
362 + avr->dccpavr_ack_ptr;
361 363
362 /* free records */ 364 /* free records */
363 list_for_each_entry_safe_from(avr, next, &av->dccpav_records, 365 list_for_each_entry_safe_from(avr, next, &av->dccpav_records,