From e0c4e6e32d9cd4b1b2c9647cd12a2e6214986e07 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Tue, 22 Oct 2024 10:44:07 -0700 Subject: session: session table holding free appns index session table may be shared among multiple appns's. app ns add id blue secret 1 if tap0 app ns add id red secret 1 if tap0 session table holds the last added app_ns's appns_index. If the last app_ns is deleted, session table is not free since there is still an appns which uses the same session table. In that case, session table is holding the free app_ns's appns_index and it can cause problem. The fix is to modify appns_index in session table to hold a vector of appns_index's instead of just the appns_index that was last added. When the app ns is deleted, remove the deleted appns_index from the session table's vector of appns_index's. Type: fix Change-Id: Ied8bc97f185071dc89b9b56656e18efbd2995131 Signed-off-by: Steven Luong --- src/plugins/unittest/session_test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c index 4e9b2fb38a1..7702e817070 100644 --- a/src/plugins/unittest/session_test.c +++ b/src/plugins/unittest/session_test.c @@ -825,6 +825,8 @@ session_test_rule_table (vlib_main_t * vm, unformat_input_t * input) session_test_enable_rule_table_engine (vm); session_table_init (st, FIB_PROTOCOL_MAX); + vec_add1 (st->appns_index, + app_namespace_index (app_namespace_get_default ())); session_rules_table_init (st, FIB_PROTOCOL_MAX); ip4_address_t lcl_ip = { @@ -2238,6 +2240,8 @@ session_test_sdl (vlib_main_t *vm, unformat_input_t *input) session_test_enable_sdl_engine (vm); session_table_init (st, FIB_PROTOCOL_MAX); + vec_add1 (st->appns_index, + app_namespace_index (app_namespace_get_default ())); session_rules_table_init (st, FIB_PROTOCOL_MAX); /* Add 1.2.0.0/16 */ -- cgit 1.2.3-korg