aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorwanghanlin <wanghanlin@corp.netease.com>2023-08-07 17:23:53 +0800
committerFlorin Coras <florin.coras@gmail.com>2023-08-07 16:58:07 +0000
commit696db20e332fcbecaaef9c5505cc2e132bfaa9e2 (patch)
tree1d26dbae5882588312da8c58585d220b5df82bf7 /src/vcl/vppcom.c
parentb22da9c7d101dca833a5c4183e7cf13943f16715 (diff)
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 <wanghanlin@corp.netease.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c7
1 files changed, 4 insertions, 3 deletions
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))