aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2024-04-04 22:09:58 -0700
committerDave Barach <vpp@barachs.net>2024-04-05 16:22:32 +0000
commitd1364402b6964cc5b2e83490bfe516e0d34becd8 (patch)
tree8313af3bad080c264719ae467ba6e0938da3e386 /src
parenta2f53c700a38df649b840eeecf0da38370a5eb0c (diff)
session: fix cleanup for refused sessions
Type: fix Change-Id: I739b7129c7e5a3fccefcdeeaf7f4a298223dd8eb Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session_input.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vnet/session/session_input.c b/src/vnet/session/session_input.c
index 5899242f975..e7a81c343f4 100644
--- a/src/vnet/session/session_input.c
+++ b/src/vnet/session/session_input.c
@@ -155,7 +155,7 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
if (app->cb_fns.session_accept_callback (s))
{
session_close (s);
- s->app_wrk_index = SESSION_INVALID_INDEX;
+ s->app_wrk_index = APP_INVALID_INDEX;
break;
}
if (is_builtin)
@@ -185,7 +185,7 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
if (rv)
{
session_close (s);
- s->app_wrk_index = SESSION_INVALID_INDEX;
+ s->app_wrk_index = APP_INVALID_INDEX;
break;
}
if (old_state >= SESSION_STATE_TRANSPORT_CLOSING)
@@ -234,10 +234,11 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
case SESSION_CTRL_EVT_CLEANUP:
s = session_get (evt->as_u64[0] & 0xffffffff, thread_index);
/* Notification enqueued before session was refused by app */
- if (PREDICT_FALSE (s->app_wrk_index == APP_INVALID_INDEX))
- break;
- if (app->cb_fns.session_cleanup_callback)
- app->cb_fns.session_cleanup_callback (s, evt->as_u64[0] >> 32);
+ if (PREDICT_TRUE (s->app_wrk_index != APP_INVALID_INDEX))
+ {
+ if (app->cb_fns.session_cleanup_callback)
+ app->cb_fns.session_cleanup_callback (s, evt->as_u64[0] >> 32);
+ }
if (evt->as_u64[0] >> 32 != SESSION_CLEANUP_SESSION)
break;
uword_to_pointer (evt->as_u64[1], void (*) (session_t * s)) (s);