DCCP protocol discussions
 help / color / mirror / Atom feed
From: Andrea Bittau <a.bittau@cs.ucl.ac.uk>
To: dccp@vger.kernel.org
Subject: [PATCH 1/1] DCCP fix calculation of ackvec length
Date: Mon, 12 Jun 2006 17:56:03 +0000	[thread overview]
Message-ID: <20060612175603.GA2279@shorty.sorbonet.org> (raw)

The length of the ack vector was incorrectly calculated upon the reception of an
"ack-of-an-ack".  This would cause the length to become "negative" [i.e. the
integer would wrap] causing an incorrect ack vector which was too long.
Consequently, the ackvector could not be inserted into packets as an option [it
semply was too long] and all packets transmitted would get dropped.  This
includes dropping pure ACKs.  Eventually, even the sender on the other side
would stop because ACKs are not being sent by the receiver.

Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk>

---

diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index 2349078..6e7d91c 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -354,11 +373,14 @@ 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,

                 reply	other threads:[~2006-06-12 17:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060612175603.GA2279@shorty.sorbonet.org \
    --to=a.bittau@cs.ucl.ac.uk \
    --cc=dccp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox