sctp: Error in calculation of RTTvar
Subsystems (3)
PATCH 1/1 sctp: Error in calculation of RTTvar
From: Schoch Christian <[email protected]>
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.
--- net/sctp/transport.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/sctp/transport.c +1 -1
@@ -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 {
Signature · 1 line
1.7.7.6
From: [email protected]
Date: Wed, 28 Nov 2012 10:18:29 -0500
Quoted 14 lines
From: Schoch Christian <[email protected]>
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)
*Replacedabs()byabs64()and long by__s64, changed patch
description.
Quoted 7 lines
Signed-off-by Christian Schoch <[email protected]>CC Vlad Yasevich <[email protected]>CC Sridhar Samudrala <[email protected]>CC Neil Horman <[email protected]>Acked-by Vlad Yasevich <[email protected]>Acked-by Neil Horman <[email protected]>
Applied, thanks.