diff options
author | Schoch Christian <[email protected]> | 2012-11-28 05:18:29 +0000 |
---|---|---|
committer | David S. Miller <[email protected]> | 2012-11-28 11:13:40 -0500 |
commit | 92d64c261e77cb2a6117887617e2a629fea6b67c (patch) | |
tree | 0021d03d1c34acb7ab099ad66bbec6f28d658613 | |
parent | 6e51fe7572590d8d86e93b547fab6693d305fd0d (diff) |
sctp: Error in calculation of RTTvar
The calculation of RTTVAR involves the subtraction of two unsigned
numbers which
may causes rollover and results in very high values of RTTVAR when RTT > SRTT.
With this patch it is possible to set RTOmin = 1 to get the minimum of RTO at
4 times the clock granularity.
Change Notes:
v2)
*Replaced abs() by abs64() and long by __s64, changed patch
description.
Signed-off-by: Christian Schoch <[email protected]>
CC: Vlad Yasevich <[email protected]>
CC: Sridhar Samudrala <[email protected]>
CC: Neil Horman <[email protected]>
CC: [email protected]
Acked-by: Vlad Yasevich <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | net/sctp/transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 953c21e4af97..206cf5238fd3 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -331,7 +331,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt) * 1/8, rto_alpha would be expressed as 3. */ tp->rttvar = tp->rttvar - (tp->rttvar >> net->sctp.rto_beta) - + ((abs(tp->srtt - rtt)) >> net->sctp.rto_beta); + + (((__u32)abs64((__s64)tp->srtt - (__s64)rtt)) >> net->sctp.rto_beta); tp->srtt = tp->srtt - (tp->srtt >> net->sctp.rto_alpha) + (rtt >> net->sctp.rto_alpha); } else { |