summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-06-10 22:50:26 -0700
committerDave Wallace <dwallacelf@gmail.com>2021-06-11 16:16:24 +0000
commit3558a9a0bab51e829da8d9b2504e44a88ad59a35 (patch)
treec4dd94e98bf3c754cd25c4689351dd47d0c4f74c
parent7dabce40244fc8d518049ee877ae8d8b1c1ca9e2 (diff)
session: half-open free only on main thread
TCP and (D)TLS clean up half-opens on main without a lock/barrier so cleanup initiated from first worker, e.g., cut-throughs, can corrupt the session pool. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2e5162831c0e201b22454f17fe55bfac44b85fa9 (cherry picked from commit 6bd54caf46aaa68dddbae6161688d428ce60550b)
-rw-r--r--src/vnet/session/session.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 56a1fd71f5a..a60735d712c 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -347,16 +347,15 @@ void
session_half_open_delete_notify (transport_connection_t *tc)
{
/* Notification from ctrl thread accepted without rpc */
- if (tc->thread_index <= 1)
+ if (!tc->thread_index)
{
session_half_open_free (ho_session_get (tc->s_index));
}
else
{
void *args = uword_to_pointer ((uword) tc->s_index, void *);
- u32 ctrl_thread = vlib_num_workers () ? 1 : 0;
- session_send_rpc_evt_to_thread (ctrl_thread, session_half_open_free_rpc,
- args);
+ session_send_rpc_evt_to_thread_force (0, session_half_open_free_rpc,
+ args);
}
}