Check that rtt and rttvar still fit in 32 bits after they are scaled by 8 and 4. Today # ip route add 198.51.100.0/24 dev lo rtt 1000000s installs "rtt 463129s". Fixes: 54e0b2e71d72 ("rto support for ip command") Signed-off-by: Dave Seddon --- ip/iproute.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ip/iproute.c b/ip/iproute.c index 067569c2..46571461 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -1332,7 +1332,8 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv) mxlock |= (1< UINT_MAX / 8)) invarg("\"rtt\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTT, (raw) ? rtt : rtt * 8); @@ -1432,7 +1433,8 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv) mxlock |= (1< UINT_MAX / 4)) invarg("\"rttvar\" value is invalid\n", *argv); rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTTVAR, (raw) ? win : win * 4); -- 2.56.0