tcp: handle acks in close wait 05/12705/2
authorFlorin Coras <fcoras@cisco.com>
Thu, 24 May 2018 03:44:12 +0000 (20:44 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 25 May 2018 17:04:31 +0000 (17:04 +0000)
Thanks to Ning Li <muziding001@163.com> for reporting.

Change-Id: I758bc6760ec5a9ec688172bc162a1873f96ab4f3
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/tcp/tcp.c
src/vnet/tcp/tcp_input.c

index b356400..25292d1 100644 (file)
@@ -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;
index ef6cb8b..c864320 100644 (file)
@@ -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);