tcp: allow syns in closed state 92/38292/13
authorFlorin Coras <fcoras@cisco.com>
Fri, 17 Feb 2023 02:59:38 +0000 (18:59 -0800)
committerDave Wallace <dwallacelf@gmail.com>
Mon, 6 Mar 2023 23:02:19 +0000 (23:02 +0000)
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: If223096cf912c1748ae417b40585a9bea5d9d9a9

src/vnet/tcp/tcp_input.c

index 9e2ff19..32de187 100644 (file)
@@ -2628,7 +2628,8 @@ tcp46_listen_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
        {
          lc = tcp_listener_get (vnet_buffer (b[0])->tcp.connection_index);
        }
-      else /* We are in TimeWait state*/
+      /* Probably we are in time-wait or closed state */
+      else
        {
          tcp_connection_t *tc;
          tc = tcp_connection_get (vnet_buffer (b[0])->tcp.connection_index,
@@ -3350,7 +3351,7 @@ do {                                                              \
   _(CLOSED, TCP_FLAG_RST | TCP_FLAG_ACK, TCP_INPUT_NEXT_DROP,
     TCP_ERROR_CONNECTION_CLOSED);
   _(CLOSED, TCP_FLAG_ACK, TCP_INPUT_NEXT_RESET, TCP_ERROR_CONNECTION_CLOSED);
-  _(CLOSED, TCP_FLAG_SYN, TCP_INPUT_NEXT_RESET, TCP_ERROR_CONNECTION_CLOSED);
+  _ (CLOSED, TCP_FLAG_SYN, TCP_INPUT_NEXT_LISTEN, TCP_ERROR_NONE);
   _(CLOSED, TCP_FLAG_FIN | TCP_FLAG_ACK, TCP_INPUT_NEXT_RESET,
     TCP_ERROR_CONNECTION_CLOSED);
 #undef _