summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp.c3
-rw-r--r--src/vnet/tcp/tcp_input.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index beadf9e1561..cbf570f2dc7 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1271,6 +1271,9 @@ tcp_timer_waitclose_handler (u32 conn_index)
else if (tc->state == TCP_STATE_FIN_WAIT_1)
{
tcp_connection_timers_reset (tc);
+ /* If FIN pending send it before closing */
+ if (tc->flags & TCP_CONN_FINPNDG)
+ tcp_send_fin (tc);
tc->state = TCP_STATE_CLOSED;
/* Wait for session layer to clean up tx events */
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLEANUP_TIME);
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index dc8fffe2291..32de369b4cc 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -2645,7 +2645,7 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
{
u32 thread_index = vm->thread_index, errors = 0, *first_buffer;
tcp_worker_ctx_t *wrk = tcp_get_worker (thread_index);
- u32 n_left_from, *from;
+ u32 n_left_from, *from, max_dequeue;
from = first_buffer = vlib_frame_vector_args (from_frame);
n_left_from = from_frame->n_vectors;
@@ -2776,7 +2776,8 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
if (tc0->flags & TCP_CONN_FINPNDG)
{
/* TX fifo finally drained */
- if (!session_tx_fifo_max_dequeue (&tc0->connection))
+ max_dequeue = session_tx_fifo_max_dequeue (&tc0->connection);
+ if (max_dequeue <= tc0->burst_acked)
tcp_send_fin (tc0);
}
/* If FIN is ACKed */