summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-11-10 22:44:52 -0800
committerDave Barach <openvpp@barachs.net>2021-11-11 15:59:12 +0000
commitef2c0f177dd3c6ea174ed210f15567b08939db4a (patch)
treeecc3a37d0f45be5e8d65cf8531510c6accafe0cf /src/vcl
parent730c1a40978a321b0788c3240db1c32274937249 (diff)
vcl: notify vpp if connected inexistent session
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6939a0cdb02067440dce01cb0771f07099ca841e
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vppcom.c12
1 files changed, 11 insertions, 1 deletions
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)