]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[DCCP] CCID2: Fix jiffie wrap issues
authorAndrea Bittau <a.bittau@cs.ucl.ac.uk>
Tue, 19 Sep 2006 20:06:46 +0000 (13:06 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:19:10 +0000 (15:19 -0700)
Jiffies are now handled correctly (I hope) in CCID2.  If they wrap, no
problem.

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>
net/dccp/ccids/ccid2.c

index b1d90c07535eecb1a2c4eaa9f7e7550562c88040..54a6b7ef3b7b38249e79eaeaf71519462d415cf5 100644 (file)
@@ -27,7 +27,6 @@
  *
  * BUGS:
  * - sequence number wrapping
- * - jiffies wrapping
  */
 
 #include "../ccid.h"
@@ -71,7 +70,8 @@ static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx)
 
                        /* packets are sent sequentially */
                        BUG_ON(seqp->ccid2s_seq <= prev->ccid2s_seq);
-                       BUG_ON(seqp->ccid2s_sent < prev->ccid2s_sent);
+                       BUG_ON(time_before(seqp->ccid2s_sent,
+                                          prev->ccid2s_sent));
                        BUG_ON(len > ccid2_seq_len);
 
                        seqp = prev;
@@ -418,8 +418,8 @@ static inline void ccid2_new_ack(struct sock *sk,
 
        /* update RTO */
        if (hctx->ccid2hctx_srtt == -1 ||
-           (jiffies - hctx->ccid2hctx_lastrtt) >= hctx->ccid2hctx_srtt) {
-               unsigned long r = jiffies - seqp->ccid2s_sent;
+           time_after(jiffies, hctx->ccid2hctx_lastrtt + hctx->ccid2hctx_srtt)) {
+               unsigned long r = (long)jiffies - (long)seqp->ccid2s_sent;
                int s;
 
                /* first measurement */