summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-08-05 14:20:54 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-08-06 14:00:20 +0000
commitf8475a7b28339d0f43cbb2308d9d41fa7e098b39 (patch)
tree8dc445f4aac050965e702bbc72c29f3404b25a18
parentd597ec7931ee753c96107663e1483940ae704039 (diff)
udp: fix session migrate when not needed
Type: fix Change-Id: I56f5f5e7e6430552f0346a65b1e5707edc28c1c0 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
-rw-r--r--src/vnet/udp/udp_input.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c
index f6d89dcf673..936d94d69ce 100644
--- a/src/vnet/udp/udp_input.c
+++ b/src/vnet/udp/udp_input.c
@@ -164,21 +164,27 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
uc0 = udp_get_connection_from_transport (tc0);
if (uc0->flags & UDP_CONN_F_CONNECTED)
{
- /*
- * Clone the transport. It will be cleaned up with the
- * session once we notify the session layer.
- */
- new_uc0 = udp_connection_clone_safe (s0->connection_index,
- s0->thread_index);
- ASSERT (s0->session_index == new_uc0->c_s_index);
-
- /*
- * Drop the 'lock' on pool resize
- */
- session_pool_remove_peeker (s0->thread_index);
- session_dgram_connect_notify (&new_uc0->connection,
- s0->thread_index, &s0);
- tc0 = &new_uc0->connection;
+ if (s0->thread_index != vlib_get_thread_index ())
+ {
+ /*
+ * Clone the transport. It will be cleaned up with the
+ * session once we notify the session layer.
+ */
+ new_uc0 =
+ udp_connection_clone_safe (s0->connection_index,
+ s0->thread_index);
+ ASSERT (s0->session_index == new_uc0->c_s_index);
+
+ /*
+ * Drop the 'lock' on pool resize
+ */
+ session_pool_remove_peeker (s0->thread_index);
+ session_dgram_connect_notify (&new_uc0->connection,
+ s0->thread_index, &s0);
+ tc0 = &new_uc0->connection;
+ }
+ else
+ s0->session_state = SESSION_STATE_READY;
}
}
else if (s0->session_state == SESSION_STATE_READY)