summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-05-04 14:25:50 -0700
committerDave Barach <openvpp@barachs.net>2017-05-07 12:38:39 +0000
commitc8343412ee0deaa8e9192cbc4846aae1e9f48a4d (patch)
treeabcf3611fe398e7744dc9c9bdb080a1453caa9e4 /src/vnet/tcp/tcp_input.c
parent3af90fceb61d0c236709c25df936bbbf304cbff5 (diff)
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 <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_input.c')
-rw-r--r--src/vnet/tcp/tcp_input.c6
1 files changed, 5 insertions, 1 deletions
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;
}