From: wanghanlin Date: Mon, 7 Aug 2023 09:23:53 +0000 (+0800) Subject: vcl: fix error state switch for VCL_STATE_LISTEN_NO_MQ sessions X-Git-Tag: v24.02-rc0~94 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=696db20e332fcbecaaef9c5505cc2e132bfaa9e2;p=vpp.git vcl: fix error state switch for VCL_STATE_LISTEN_NO_MQ sessions When a VCL_STATE_LISTEN_NO_MQ session receives an ACCEPTED message, but then receives either a RESET or DISCONNECTED message from VPP before the session is unlistened, the listen session state is switched to DISCONNECT. The subsequent CLEANUP message handler attempts to send a reset reply message to VPP, but since the vpp_evt_q for the listen session is null, this leads to a crash. Type: fix Change-Id: Id7e88dcb16df3eda912b3f763730ec8d8973473a Signed-off-by: wanghanlin --- diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 06a345d5792..1791b1be7f8 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -513,9 +513,9 @@ vcl_session_reset_handler (vcl_worker_t * wrk, } /* Caught a reset before actually accepting the session */ - if (session->session_state == VCL_STATE_LISTEN) + if (session->session_state == VCL_STATE_LISTEN || + session->session_state == VCL_STATE_LISTEN_NO_MQ) { - if (!vcl_flag_accepted_session (session, reset_msg->handle, VCL_ACCEPTED_F_RESET)) VDBG (0, "session was not accepted!"); @@ -706,7 +706,8 @@ vcl_session_disconnected_handler (vcl_worker_t * wrk, return 0; /* Caught a disconnect before actually accepting the session */ - if (session->session_state == VCL_STATE_LISTEN) + if (session->session_state == VCL_STATE_LISTEN || + session->session_state == VCL_STATE_LISTEN_NO_MQ) { if (!vcl_flag_accepted_session (session, msg->handle, VCL_ACCEPTED_F_CLOSED))