aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vppcom.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 9a351d8aca6..3d08d395a27 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -822,13 +822,27 @@ static int
vppcom_session_unbind (u32 session_handle)
{
vcl_worker_t *wrk = vcl_worker_get_current ();
+ session_accepted_msg_t *accepted_msg;
vcl_session_t *session = 0;
+ vcl_session_msg_t *evt;
u64 vpp_handle;
session = vcl_session_get_w_handle (wrk, session_handle);
if (!session)
return VPPCOM_EBADFD;
+ /* Flush pending accept events, if any */
+ while (clib_fifo_elts (session->accept_evts_fifo))
+ {
+ clib_fifo_sub2 (session->accept_evts_fifo, evt);
+ accepted_msg = &evt->accepted_msg;
+ vcl_session_table_del_vpp_handle (wrk, accepted_msg->handle);
+ vcl_send_session_accepted_reply (session->vpp_evt_q,
+ accepted_msg->context,
+ session->vpp_handle, -1);
+ }
+ clib_fifo_free (session->accept_evts_fifo);
+
vpp_handle = session->vpp_handle;
session->vpp_handle = ~0;
session->session_state = STATE_DISCONNECT;