From 7371663aeb5921c7f43dbf0a6fb1f934ed64014f Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 1 May 2021 02:32:29 +0000 Subject: [PATCH] send DLCX only once If the mgcp_client_fsm gets terminated in ST_DLCX_RESP, it has already sent a DLCX to the MGW. So do not send a second one. I noticed the duplicate DLCX for the same endpoint conn identifier while running TTCN3 tests and watching the network trace of test teardown. Change-Id: I35e415f67946b73c74408afe265618cfe4f72b0b --- src/libosmo-mgcp-client/mgcp_client_fsm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index 83dd2f1ff..9e4a1003b 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -521,8 +521,10 @@ static void fsm_cleanup_cb(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause ca /* Should the FSM be terminated while there are still open connections * on the MGW, we send an unconditional DLCX to terminate the * connection. This is not the normal case. The user should always use - * mgcp_conn_delete() to instruct the FSM to perform a graceful exit */ - if (strlen(mgcp_ctx->conn_id)) { + * mgcp_conn_delete() to instruct the FSM to perform a graceful exit. + * If in ST_DLCX_RESP, a DLCX was already sent and we did not get a + * response. No point in sending another one. */ + if (fi->state != ST_DLCX_RESP && strlen(mgcp_ctx->conn_id)) { LOGPFSML(fi, LOGL_NOTICE, "MGW/DLCX: FSM termination with connections still present, sending unconditional DLCX...\n"); msg = make_dlcx_msg(mgcp_ctx);