diff options
author | Andrea Bittau <a.bittau@cs.ucl.ac.uk> | 2006-09-19 16:06:46 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:19:10 -0400 |
commit | 29651cda97b0a9e4ac0fbeb5ea731a9909f0f128 (patch) | |
tree | 3b6002e4fa3bdf7d233b8d46654effe9f816d505 /net/dccp | |
parent | 4a0a50fb43912b4a593d2416c507a198fe607a6d (diff) |
[DCCP] CCID2: Fix jiffie wrap issues
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>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/ccid2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index b1d90c07535e..54a6b7ef3b7b 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -27,7 +27,6 @@ | |||
27 | * | 27 | * |
28 | * BUGS: | 28 | * BUGS: |
29 | * - sequence number wrapping | 29 | * - sequence number wrapping |
30 | * - jiffies wrapping | ||
31 | */ | 30 | */ |
32 | 31 | ||
33 | #include "../ccid.h" | 32 | #include "../ccid.h" |
@@ -71,7 +70,8 @@ static void ccid2_hc_tx_check_sanity(const struct ccid2_hc_tx_sock *hctx) | |||
71 | 70 | ||
72 | /* packets are sent sequentially */ | 71 | /* packets are sent sequentially */ |
73 | BUG_ON(seqp->ccid2s_seq <= prev->ccid2s_seq); | 72 | BUG_ON(seqp->ccid2s_seq <= prev->ccid2s_seq); |
74 | BUG_ON(seqp->ccid2s_sent < prev->ccid2s_sent); | 73 | BUG_ON(time_before(seqp->ccid2s_sent, |
74 | prev->ccid2s_sent)); | ||
75 | BUG_ON(len > ccid2_seq_len); | 75 | BUG_ON(len > ccid2_seq_len); |
76 | 76 | ||
77 | seqp = prev; | 77 | seqp = prev; |
@@ -418,8 +418,8 @@ static inline void ccid2_new_ack(struct sock *sk, | |||
418 | 418 | ||
419 | /* update RTO */ | 419 | /* update RTO */ |
420 | if (hctx->ccid2hctx_srtt == -1 || | 420 | if (hctx->ccid2hctx_srtt == -1 || |
421 | (jiffies - hctx->ccid2hctx_lastrtt) >= hctx->ccid2hctx_srtt) { | 421 | time_after(jiffies, hctx->ccid2hctx_lastrtt + hctx->ccid2hctx_srtt)) { |
422 | unsigned long r = jiffies - seqp->ccid2s_sent; | 422 | unsigned long r = (long)jiffies - (long)seqp->ccid2s_sent; |
423 | int s; | 423 | int s; |
424 | 424 | ||
425 | /* first measurement */ | 425 | /* first measurement */ |