aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-11-24 17:43:59 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:52 -0500
commitcfbbeabc8864902c4af1c0cadf0972b352930a26 (patch)
tree90b544b5ad57bd49c25715a595ccd23d227dd714
parent3de5489f47febe0333b142e0eb6389b9924b2634 (diff)
[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> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/dccp/ccids/ccid2.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 7873dc78b6bc..55522182f2fa 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -24,9 +24,6 @@
24 24
25/* 25/*
26 * This implementation should follow RFC 4341 26 * This implementation should follow RFC 4341
27 *
28 * BUGS:
29 * - sequence number wrapping
30 */ 27 */
31 28
32#include "../ccid.h" 29#include "../ccid.h"
@@ -619,9 +616,8 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
619 /* go through this ack vector */ 616 /* go through this ack vector */
620 while (veclen--) { 617 while (veclen--) {
621 const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK; 618 const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK;
622 u64 ackno_end_rl; 619 u64 ackno_end_rl = SUB48(ackno, rl);
623 620
624 dccp_set_seqno(&ackno_end_rl, ackno - rl);
625 ccid2_pr_debug("ackvec start:%llu end:%llu\n", 621 ccid2_pr_debug("ackvec start:%llu end:%llu\n",
626 (unsigned long long)ackno, 622 (unsigned long long)ackno,
627 (unsigned long long)ackno_end_rl); 623 (unsigned long long)ackno_end_rl);
@@ -671,8 +667,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
671 if (done) 667 if (done)
672 break; 668 break;
673 669
674 670 ackno = SUB48(ackno_end_rl, 1);
675 dccp_set_seqno(&ackno, ackno_end_rl - 1);
676 vector++; 671 vector++;
677 } 672 }
678 if (done) 673 if (done)