aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorGravatar Yuchung Cheng <ycheng@google.com> 2013-10-24 08:55:25 -0700
committerGravatar David S. Miller <davem@davemloft.net> 2013-10-27 16:50:06 -0400
commit2909d874f34eae157aecab0af27c6dc4a1751f8f (patch)
treeacbb596083058b7cff6edd7d96bd5411597fa5ea /net/ipv4/tcp_input.c
parenttcp: fix SYNACK RTT estimation in Fast Open (diff)
downloadlinux-2909d874f34eae157aecab0af27c6dc4a1751f8f.tar.gz
linux-2909d874f34eae157aecab0af27c6dc4a1751f8f.tar.bz2
linux-2909d874f34eae157aecab0af27c6dc4a1751f8f.zip
tcp: only take RTT from timestamps if new data is acked
Patch ed08495c3 "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>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 305cd0526a78..6ffe41a82c00 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2856,7 +2856,8 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
* left edge of the send window.
* See draft-ietf-tcplw-high-performance-00, section 3.3.
*/
- if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr)
+ if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
+ flag & FLAG_ACKED)
seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
if (seq_rtt < 0)