Skip to content

Commit 2909d87

Browse files
yuchungchengdavem330
authored andcommitted
tcp: only take RTT from timestamps if new data is acked
Patch ed08495 "tcp: use RTT from SACK for RTO" has a bug that it does not check if the ACK acknowledge new data before taking the RTT sample from TCP timestamps. This patch adds the check back as required by the RFC. Signed-off-by: Yuchung Cheng <ycheng@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bc15afa commit 2909d87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2856,7 +2856,8 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
28562856
* left edge of the send window.
28572857
* See draft-ietf-tcplw-high-performance-00, section 3.3.
28582858
*/
2859-
if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
2859+
if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
2860+
flag & FLAG_ACKED)
28602861
seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
28612862

28622863
if (seq_rtt < 0)

0 commit comments

Comments
 (0)