summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-10-16 20:30:31 -0700
committerDamjan Marion <dmarion@me.com>2018-10-17 09:40:22 +0000
commitc977e7c100f5727183f9452e2c0d086623a21d15 (patch)
tree381cf151a45ffce5b2b2082c8efc251203933405 /src/vnet
parent34ca075636cc9a7974cd4483f28303137a7d42df (diff)
tcp: fix multiple fin retries (VPP-1461)
Change-Id: I1be7c59df7b48875f81ebeebf5f39ed15a43d2d8 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/session-apps/echo_client.c2
-rw-r--r--src/vnet/tcp/tcp_output.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index 0258c16520a..1fd7ad0cd9f 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -765,7 +765,7 @@ echo_clients_command_fn (vlib_main_t * vm,
/* Fire off connect requests */
time_before_connects = vlib_time_now (vm);
if ((error = echo_clients_connect (vm, n_clients)))
- return error;
+ goto cleanup;
/* Park until the sessions come up, or ten seconds elapse... */
vlib_process_wait_for_event_or_clock (vm, syn_timeout);
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 79d64cf2da3..7d7c32ad210 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1076,24 +1076,25 @@ tcp_send_fin (tcp_connection_t * tc)
u32 bi;
u8 fin_snt = 0;
- tcp_retransmit_timer_force_update (tc);
+ fin_snt = tc->flags & TCP_CONN_FINSNT;
+ if (fin_snt)
+ tc->snd_nxt = tc->snd_una;
+
if (PREDICT_FALSE (tcp_get_free_buffer_index (tm, &bi)))
{
/* Out of buffers so program fin retransmit ASAP */
tcp_timer_update (tc, TCP_TIMER_RETRANSMIT, 1);
- tc->flags |= TCP_CONN_FINSNT;
- tc->snd_una_max += 1;
- tc->snd_nxt = tc->snd_una_max;
- return;
+ goto post_enqueue;
}
+ tcp_retransmit_timer_force_update (tc);
b = vlib_get_buffer (vm, bi);
tcp_init_buffer (vm, b);
- fin_snt = tc->flags & TCP_CONN_FINSNT;
- if (fin_snt)
- tc->snd_nxt = tc->snd_una;
tcp_make_fin (tc, b);
tcp_enqueue_to_output_now (vm, b, bi, tc->c_is_ip4);
+ TCP_EVT_DBG (TCP_EVT_FIN_SENT, tc);
+
+post_enqueue:
if (!fin_snt)
{
tc->flags |= TCP_CONN_FINSNT;
@@ -1106,7 +1107,6 @@ tcp_send_fin (tcp_connection_t * tc)
{
tc->snd_nxt = tc->snd_una_max;
}
- TCP_EVT_DBG (TCP_EVT_FIN_SENT, tc);
}
always_inline u8