diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-03-02 04:46:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-03 01:49:18 -0500 |
commit | f61f6f82c90cbaa85270f26b89e3309a8c6e2e88 (patch) | |
tree | 973fd185d1540014322153ba1b3fc8273590d8d6 /net/sctp | |
parent | c6db93a58f1745cfe1acc2e1a1d68afc3245eced (diff) |
sctp: use time_before or time_after for comparing jiffies
The functions time_before or time_after are more robust
for comparing jiffies against other values.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/outqueue.c | 3 | ||||
-rw-r--r-- | net/sctp/transport.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index bc411c896216..a367d15a21aa 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -428,7 +428,8 @@ void sctp_retransmit_mark(struct sctp_outq *q, | |||
428 | * retransmitting due to T3 timeout. | 428 | * retransmitting due to T3 timeout. |
429 | */ | 429 | */ |
430 | if (reason == SCTP_RTXR_T3_RTX && | 430 | if (reason == SCTP_RTXR_T3_RTX && |
431 | (jiffies - chunk->sent_at) < transport->last_rto) | 431 | time_before(jiffies, chunk->sent_at + |
432 | transport->last_rto)) | ||
432 | continue; | 433 | continue; |
433 | 434 | ||
434 | /* RFC 2960 6.2.1 Processing a Received SACK | 435 | /* RFC 2960 6.2.1 Processing a Received SACK |
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 5c29b14ee9af..e5dde45c79d3 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
@@ -543,8 +543,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, | |||
543 | * congestion indications more than once every window of | 543 | * congestion indications more than once every window of |
544 | * data (or more loosely more than once every round-trip time). | 544 | * data (or more loosely more than once every round-trip time). |
545 | */ | 545 | */ |
546 | if ((jiffies - transport->last_time_ecne_reduced) > | 546 | if (time_after(jiffies, transport->last_time_ecne_reduced + |
547 | transport->rtt) { | 547 | transport->rtt)) { |
548 | transport->ssthresh = max(transport->cwnd/2, | 548 | transport->ssthresh = max(transport->cwnd/2, |
549 | 4*transport->asoc->pathmtu); | 549 | 4*transport->asoc->pathmtu); |
550 | transport->cwnd = transport->ssthresh; | 550 | transport->cwnd = transport->ssthresh; |
@@ -561,7 +561,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, | |||
561 | * to be done every RTO interval, we do it every hearbeat | 561 | * to be done every RTO interval, we do it every hearbeat |
562 | * interval. | 562 | * interval. |
563 | */ | 563 | */ |
564 | if ((jiffies - transport->last_time_used) > transport->rto) | 564 | if (time_after(jiffies, transport->last_time_used + |
565 | transport->rto)) | ||
565 | transport->cwnd = max(transport->cwnd/2, | 566 | transport->cwnd = max(transport->cwnd/2, |
566 | 4*transport->asoc->pathmtu); | 567 | 4*transport->asoc->pathmtu); |
567 | break; | 568 | break; |