From: Florin Coras Date: Mon, 8 Jul 2019 20:00:00 +0000 (-0700) Subject: vcl: cleanup listener accept fifo X-Git-Tag: v20.01-rc0~234 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=aaff5eefb1dddf3ea71e3258b362d6516350303e vcl: cleanup listener accept fifo Type: fix Change-Id: Ic470d429f4bf1924185f720d66efe06f4727bcbd Signed-off-by: Florin Coras --- 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;