tcp: fix tcp_probe_timer() for TCP_USER_TIMEOUT
authorEric Dumazet <[email protected]>
Sun, 21 May 2017 17:39:00 +0000 (10:39 -0700)
committerDavid S. Miller <[email protected]>
Sun, 21 May 2017 17:50:34 +0000 (13:50 -0400)
TCP_USER_TIMEOUT is still converted to jiffies value in
icsk_user_timeout

So we need to make a conversion for the cases HZ != 1000

Fixes: 9a568de4818d ("tcp: switch TCP TS option (RFC 7323) to 1ms clock")
Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Soheil Hassas Yeganeh <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/ipv4/tcp_timer.c

index 27a667bce8060e6b2290fe636c27a79d0d593b48..c4a35ba7f8ed0dac573c864900b081b4847927d8 100644 (file)
@@ -341,7 +341,8 @@ static void tcp_probe_timer(struct sock *sk)
        if (!start_ts)
                tcp_send_head(sk)->skb_mstamp = tp->tcp_mstamp;
        else if (icsk->icsk_user_timeout &&
-                (s32)(tcp_time_stamp(tp) - start_ts) > icsk->icsk_user_timeout)
+                (s32)(tcp_time_stamp(tp) - start_ts) >
+                jiffies_to_msecs(icsk->icsk_user_timeout))
                goto abort;
 
        max_probes = sock_net(sk)->ipv4.sysctl_tcp_retries2;