Change in osmo-bsc[master]: bsc_subscr_conn_fsm: fix mgw-pool ref counting

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Oct 28 15:02:58 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26011 )


Change subject: bsc_subscr_conn_fsm: fix mgw-pool ref counting
......................................................................

bsc_subscr_conn_fsm: fix mgw-pool ref counting

When the gsm_subscr_conn_fsm (GSCO) terminates abormally it might not go
through the forget-mgw-endpoint mechanism. It might be terminated
forcefully, which means only the pre_term callback runs. The pre_term
callback clears the endpoint, but it does not put the mgcp_client
reference back into the pool. This results into a wrong ref-count in the
mgw-pool.

Change-Id: I5a7ce6a1880a1060df74d03dd4eb38b51fd85c69
Related: SYS#5675
---
M src/osmo-bsc/bsc_subscr_conn_fsm.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/26011/1

diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 1e61d3f..c18079f 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -955,8 +955,14 @@
 static void gscon_pre_term(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
 {
 	struct gsm_subscriber_connection *conn = fi->priv;
+	struct mgcp_client *mgcp_client;
+
+	/* Put MGCP client back into MGW pool */
+	mgcp_client = osmo_mgcpc_ep_client(conn->user_plane.mgw_endpoint);
+	mgcp_client_pool_put(mgcp_client);
 
 	osmo_mgcpc_ep_clear(conn->user_plane.mgw_endpoint);
+	conn->user_plane.mgw_endpoint = NULL;
 
 	if (conn->lcls.fi) {
 		/* request termination of LCLS FSM */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/26011
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5a7ce6a1880a1060df74d03dd4eb38b51fd85c69
Gerrit-Change-Number: 26011
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211028/3e1cc824/attachment.htm>


More information about the gerrit-log mailing list