From 56318932367ecb3fa65243033f1f8978c32fd4a4 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 23 May 2018 20:44:12 -0700 Subject: tcp: handle acks in close wait Thanks to Ning Li for reporting. Change-Id: I758bc6760ec5a9ec688172bc162a1873f96ab4f3 Signed-off-by: Florin Coras --- src/vnet/tcp/tcp.c | 2 +- src/vnet/tcp/tcp_input.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index b3564004dd4..25292d1e588 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -333,8 +333,8 @@ tcp_connection_close (tcp_connection_t * tc) tc->state = TCP_STATE_FIN_WAIT_1; break; case TCP_STATE_CLOSE_WAIT: - tcp_connection_timers_reset (tc); tcp_send_fin (tc); + tcp_connection_timers_reset (tc); tc->state = TCP_STATE_LAST_ACK; tcp_timer_update (tc, TCP_TIMER_WAITCLOSE, TCP_2MSL_TIME); break; diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index ef6cb8b8fa2..c86432037fd 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -3248,6 +3248,7 @@ do { \ /* FIN in reply to our FIN from the other side */ _(FIN_WAIT_1, TCP_FLAG_FIN, TCP_INPUT_NEXT_RCV_PROCESS, TCP_ERROR_NONE); _(FIN_WAIT_1, TCP_FLAG_RST, TCP_INPUT_NEXT_RCV_PROCESS, TCP_ERROR_NONE); + _(CLOSING, TCP_FLAG_ACK, TCP_INPUT_NEXT_RCV_PROCESS, TCP_ERROR_NONE); /* FIN confirming that the peer (app) has closed */ _(FIN_WAIT_2, TCP_FLAG_FIN, TCP_INPUT_NEXT_RCV_PROCESS, TCP_ERROR_NONE); _(FIN_WAIT_2, TCP_FLAG_ACK, TCP_INPUT_NEXT_RCV_PROCESS, TCP_ERROR_NONE); -- cgit 1.2.3-korg