DCCP protocol discussions
 help / color / mirror / Atom feed
* [PATCH 01/11] ACKVEC: fix ackvector length calculation
@ 2006-06-22 17:51 Andrea Bittau
  0 siblings, 0 replies; only message in thread
From: Andrea Bittau @ 2006-06-22 17:51 UTC (permalink / raw)
  To: dccp

Fix ackvector length calculation upon receiving an "ack-of-ack".  This patch
aviods 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>

---

diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index 8c211c5..8dab723 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -353,11 +353,13 @@ static void dccp_ackvec_throw_record(str
 {
 	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,

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-22 17:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-22 17:51 [PATCH 01/11] ACKVEC: fix ackvector length calculation Andrea Bittau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox