]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commit
iproute: fix unit conversion of rtt/rttvar/rto_min
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Fri, 25 Feb 2011 20:51:48 +0000 (12:51 -0800)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 25 Feb 2011 20:51:48 +0000 (12:51 -0800)
commit9b2cdc00dab7b601938901e20b5e1e66188d388b
treeda97e90c3c495cc1f00b4842197ae657e7cc44dd
parent94089ef7726cc25bffbd133fe5e1e16e0fd4654e
iproute: fix unit conversion of rtt/rttvar/rto_min

Since July 2008 (2.6.27, c1e20f7c8b9), the kernel stores the values for
RTAX_{RTT{,VAR},RTO_MIN} in milliseconds. When using a kernel > 2.6.27 with
the current iproute2, conversion of these values is broken in either way.

This patch
 * updates the code to pass and retrieve milliseconds;
 * since values < 1msec would be rounded up, also drops the usec/nsec variants;
 * since there is no way to query kernel HZ, also drops the jiffies variant.

Arguments such as
rtt 3.23sec
rto_min 0xff
rto_min 0.200s
rttvar 25ms
now all work as expected when reading back previously set values.
ip/iproute.c
lib/utils.c
man/man8/ip.8