From ef2c0f177dd3c6ea174ed210f15567b08939db4a Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 10 Nov 2021 22:44:52 -0800 Subject: [PATCH] vcl: notify vpp if connected inexistent session Type: improvement Signed-off-by: Florin Coras Change-Id: I6939a0cdb02067440dce01cb0771f07099ca841e --- src/vcl/vppcom.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 9f8edce4965..207e208979c 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -508,10 +508,20 @@ vcl_session_connected_handler (vcl_worker_t * wrk, session_index = mp->context; session = vcl_session_get (wrk, session_index); - if (!session) + if (PREDICT_FALSE (!session)) { VDBG (0, "ERROR: vpp handle 0x%llx has no session index (%u)!", mp->handle, session_index); + /* Should not happen but if it does, force vpp session cleanup */ + vcl_session_t tmp_session = { + .vpp_handle = mp->handle, + .vpp_evt_q = 0, + }; + vcl_segment_attach_session ( + mp->segment_handle, mp->server_rx_fifo, mp->server_tx_fifo, + mp->vpp_event_queue_address, mp->mq_index, 0, session); + if (tmp_session.vpp_evt_q) + vcl_send_session_disconnect (wrk, &tmp_session); return VCL_INVALID_SESSION_INDEX; } if (mp->retval) -- 2.16.6