summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-02-28 12:49:45 -0800
committerJohn Lo <loj@cisco.com>2019-03-01 23:26:33 +0000
commit6342e48dc1aa5a083b34ca6cae26bf3672cd800b (patch)
tree6a1b45e4fa60cebe85c40451dad9297270ba9cb3
parent46ee286753d10e0afe06fee6121519d57bb50793 (diff)
tcp: allow future acks if in window
Change-Id: I84ad1830b8db43f6031cf2876cd94f6a71216b83 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 5fd3210be3a043c12c598df3d75dbe0aa606bfe5)
-rw-r--r--src/vnet/tcp/tcp_input.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index f1f945e1092..392d694030e 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -1523,10 +1523,11 @@ tcp_rcv_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, vlib_buffer_t * b,
/* If the ACK acks something not yet sent (SEG.ACK > SND.NXT) */
if (PREDICT_FALSE (seq_gt (vnet_buffer (b)->tcp.ack_number, tc->snd_nxt)))
{
- /* When we entered recovery, we reset snd_nxt to snd_una. Seems peer
- * still has the data so accept the ack */
- if (tcp_in_recovery (tc)
- && seq_leq (vnet_buffer (b)->tcp.ack_number, tc->snd_congestion))
+ /* When we entered cong recovery, we reset snd_nxt to snd_una. Seems
+ * peer still has the data so accept the ack */
+ if (tcp_in_cong_recovery (tc)
+ && seq_leq (vnet_buffer (b)->tcp.ack_number,
+ tc->snd_una + tc->snd_wnd))
{
tc->snd_nxt = vnet_buffer (b)->tcp.ack_number;
if (seq_gt (tc->snd_nxt, tc->snd_una_max))
@@ -1550,6 +1551,10 @@ tcp_rcv_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, vlib_buffer_t * b,
vnet_buffer (b)->tcp.ack_number);
tc->snd_nxt = vnet_buffer (b)->tcp.ack_number;
+ if (seq_gt (tc->snd_nxt, tc->snd_una_max))
+ tc->snd_una_max = tc->snd_nxt;
+
+ goto process_ack;
}
/* If old ACK, probably it's an old dupack */