diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-03-02 09:46:13 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-02 22:49:18 -0800 |
commit | f61f6f82c90cbaa85270f26b89e3309a8c6e2e88 (patch) | |
tree | 973fd185d1540014322153ba1b3fc8273590d8d6 /net/sctp/transport.c | |
parent | c6db93a58f1745cfe1acc2e1a1d68afc3245eced (diff) | |
download | blackbird-op-linux-f61f6f82c90cbaa85270f26b89e3309a8c6e2e88.tar.gz blackbird-op-linux-f61f6f82c90cbaa85270f26b89e3309a8c6e2e88.zip |
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/transport.c')
-rw-r--r-- | net/sctp/transport.c | 7 |
1 files changed, 4 insertions, 3 deletions
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, * congestion indications more than once every window of * data (or more loosely more than once every round-trip time). */ - if ((jiffies - transport->last_time_ecne_reduced) > - transport->rtt) { + if (time_after(jiffies, transport->last_time_ecne_reduced + + transport->rtt)) { transport->ssthresh = max(transport->cwnd/2, 4*transport->asoc->pathmtu); transport->cwnd = transport->ssthresh; @@ -561,7 +561,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, * to be done every RTO interval, we do it every hearbeat * interval. */ - if ((jiffies - transport->last_time_used) > transport->rto) + if (time_after(jiffies, transport->last_time_used + + transport->rto)) transport->cwnd = max(transport->cwnd/2, 4*transport->asoc->pathmtu); break; |