From c8343412ee0deaa8e9192cbc4846aae1e9f48a4d Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 4 May 2017 14:25:50 -0700 Subject: Include TCP options in segment size computation Ensure that TCP data plus options does not exceed peer's advertised MSS. Change-Id: I0de824cb3619346f0394dd694942fc1cf33a82b7 Signed-off-by: Florin Coras --- src/vnet/tcp/tcp_input.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/vnet/tcp/tcp_input.c') diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index e9c52c5e27f..d268251cb38 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -389,10 +389,14 @@ static int tcp_update_rtt (tcp_connection_t * tc, u32 ack) { u32 mrtt = 0; + u8 rtx_acked; + + /* Determine if only rtx bytes are acked. TODO fast retransmit */ + rtx_acked = tc->rto_boff && (tc->bytes_acked <= tc->snd_mss); /* Karn's rule, part 1. Don't use retransmitted segments to estimate * RTT because they're ambiguous. */ - if (tc->rtt_ts && seq_geq (ack, tc->rtt_seq) && !tc->rto_boff) + if (tc->rtt_ts && seq_geq (ack, tc->rtt_seq) && !rtx_acked) { mrtt = tcp_time_now () - tc->rtt_ts; } -- cgit 1.2.3-korg