session: move connects to first worker
[vpp.git] / src / vnet / tcp / tcp_inlines.h
index 68eb4b1..91c5757 100644 (file)
@@ -66,10 +66,7 @@ tcp_listener_get (u32 tli)
 always_inline tcp_connection_t *
 tcp_half_open_connection_get (u32 conn_index)
 {
-  tcp_connection_t *tc = 0;
-  if (!pool_is_free_index (tcp_main.half_open_connections, conn_index))
-    tc = pool_elt_at_index (tcp_main.half_open_connections, conn_index);
-  return tc;
+  return tcp_connection_get (conn_index, transport_cl_thread ());
 }
 
 /**
@@ -296,7 +293,7 @@ tcp_input_lookup_buffer (vlib_buffer_t * b, u8 thread_index, u32 * error,
            {
              ip6_main_t *im = &ip6_main;
              fib_index = vec_elt (im->fib_index_by_sw_if_index,
-                                  vnet_buffer (b)->sw_if_index[VLIB_RX]);
+                                  vnet_buffer (b)->ip.rx_sw_if_index);
            }
 
          tc = session_lookup_connection_wt6 (fib_index, &ip6->dst_address,
@@ -307,6 +304,10 @@ tcp_input_lookup_buffer (vlib_buffer_t * b, u8 thread_index, u32 * error,
        }
     }
 
+  /* Set the sw_if_index[VLIB_RX] to the interface we received
+   * the connection on (the local interface) */
+  vnet_buffer (b)->sw_if_index[VLIB_RX] = vnet_buffer (b)->ip.rx_sw_if_index;
+
   if (is_nolookup)
     tc =
       (transport_connection_t *) tcp_connection_get (vnet_buffer (b)->