aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-12-12 21:22:52 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-13 16:04:04 -0500
commit4688eb7cf3ae2c2721d1dacff5c1384cba47d176 (patch)
tree4d28b821e9e14fc5d73a5d12272ce8b817d32ef4 /net/ipv4/tcp_timer.c
parent9ee11bd03cb1a5c3ca33c2bb70e7ed325f68890f (diff)
tcp: refresh tcp_mstamp from timers callbacks
Only the retransmit timer currently refreshes tcp_mstamp We should do the same for delayed acks and keepalives. Even if RFC 7323 does not request it, this is consistent to what linux did in the past, when TS values were based on jiffies. Fixes: 385e20706fac ("tcp: use tp->tcp_mstamp in output path") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Soheil Hassas Yeganeh <soheil@google.com> Cc: Mike Maloney <maloney@google.com> Cc: Neal Cardwell <ncardwell@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Mike Maloney <maloney@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 16df6dd44b98..968fda198376 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -264,6 +264,7 @@ void tcp_delack_timer_handler(struct sock *sk)
264 icsk->icsk_ack.pingpong = 0; 264 icsk->icsk_ack.pingpong = 0;
265 icsk->icsk_ack.ato = TCP_ATO_MIN; 265 icsk->icsk_ack.ato = TCP_ATO_MIN;
266 } 266 }
267 tcp_mstamp_refresh(tcp_sk(sk));
267 tcp_send_ack(sk); 268 tcp_send_ack(sk);
268 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKS); 269 __NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKS);
269 } 270 }
@@ -632,6 +633,7 @@ static void tcp_keepalive_timer (struct timer_list *t)
632 goto out; 633 goto out;
633 } 634 }
634 635
636 tcp_mstamp_refresh(tp);
635 if (sk->sk_state == TCP_FIN_WAIT2 && sock_flag(sk, SOCK_DEAD)) { 637 if (sk->sk_state == TCP_FIN_WAIT2 && sock_flag(sk, SOCK_DEAD)) {
636 if (tp->linger2 >= 0) { 638 if (tp->linger2 >= 0) {
637 const int tmo = tcp_fin_time(sk) - TCP_TIMEWAIT_LEN; 639 const int tmo = tcp_fin_time(sk) - TCP_TIMEWAIT_LEN;