DCCP protocol discussions
 help / color / mirror / Atom feed
* [PATCH 3/6]: Fix sequence number arithmetic/comparisons
@ 2007-10-27 11:34 Gerrit Renker
  2007-10-27 22:18 ` Ian McDonald
  0 siblings, 1 reply; 2+ messages in thread
From: Gerrit Renker @ 2007-10-27 11:34 UTC (permalink / raw)
  To: dccp

[CCID2]: Fix sequence number arithmetic/comparisons

This replaces use of normal subtraction with modulo-48 subtraction.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
 net/dccp/ccids/ccid2.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -24,9 +24,6 @@
 
 /*
  * This implementation should follow RFC 4341
- *
- * BUGS:
- * - sequence number wrapping
  */
 
 #include "../ccid.h"
@@ -619,9 +616,8 @@ static void ccid2_hc_tx_packet_recv(stru
 		/* go through this ack vector */
 		while (veclen--) {
 			const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK;
-			u64 ackno_end_rl;
+			u64 ackno_end_rl = SUB48(ackno, rl);
 
-			dccp_set_seqno(&ackno_end_rl, ackno - rl);
 			ccid2_pr_debug("ackvec start:%llu end:%llu\n",
 				       (unsigned long long)ackno,
 				       (unsigned long long)ackno_end_rl);
@@ -671,8 +667,7 @@ static void ccid2_hc_tx_packet_recv(stru
 			if (done)
 				break;
 
-
-			dccp_set_seqno(&ackno, ackno_end_rl - 1);
+			ackno = SUB48(ackno_end_rl, 1);
 			vector++;
 		}
 		if (done)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/6]: Fix sequence number arithmetic/comparisons
  2007-10-27 11:34 [PATCH 3/6]: Fix sequence number arithmetic/comparisons Gerrit Renker
@ 2007-10-27 22:18 ` Ian McDonald
  0 siblings, 0 replies; 2+ messages in thread
From: Ian McDonald @ 2007-10-27 22:18 UTC (permalink / raw)
  To: dccp

On 10/28/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [CCID2]: Fix sequence number arithmetic/comparisons
>
> This replaces use of normal subtraction with modulo-48 subtraction.
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>

Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-27 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-27 11:34 [PATCH 3/6]: Fix sequence number arithmetic/comparisons Gerrit Renker
2007-10-27 22:18 ` Ian McDonald

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