tcp: call accept notify after full connection init 63/9363/1
authorFlorin Coras <fcoras@cisco.com>
Fri, 10 Nov 2017 00:26:03 +0000 (16:26 -0800)
committerFlorin Coras <fcoras@cisco.com>
Fri, 10 Nov 2017 00:38:40 +0000 (16:38 -0800)
Change-Id: I69998aa4eb587d80fc61d14bb28a9318a318f9ec
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/tcp/tcp_input.c

index 916d7ea..6d7beba 100644 (file)
@@ -2753,15 +2753,6 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
                           sizeof (ip6_address_t));
            }
 
-         if (stream_session_accept (&child0->connection, lc0->c_s_index,
-                                    0 /* notify */ ))
-           {
-             clib_warning ("session accept fail");
-             tcp_connection_cleanup (child0);
-             error0 = TCP_ERROR_CREATE_SESSION_FAIL;
-             goto drop;
-           }
-
          if (tcp_options_parse (th0, &child0->rcv_opts))
            {
              clib_warning ("options parse fail");
@@ -2791,6 +2782,15 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          tcp_connection_init_vars (child0);
          TCP_EVT_DBG (TCP_EVT_SYN_RCVD, child0, 1);
 
+         if (stream_session_accept (&child0->connection, lc0->c_s_index,
+                                    0 /* notify */ ))
+           {
+             clib_warning ("session accept fail");
+             tcp_connection_cleanup (child0);
+             error0 = TCP_ERROR_CREATE_SESSION_FAIL;
+             goto drop;
+           }
+
          /* Reuse buffer to make syn-ack and send */
          tcp_make_synack (child0, b0);
          next0 = tcp_next_output (is_ip4);