Change in osmo-bsc[master]: fix gscon clear 1/n: store clear cause in gscon

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/.

neels gerrit-no-reply at lists.osmocom.org
Fri Dec 17 13:55:15 UTC 2021


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


Change subject: fix gscon clear 1/n: store clear cause in gscon
......................................................................

fix gscon clear 1/n: store clear cause in gscon

Allow returning a context sensitive cause instead of a hardcoded one in
gscon pre_term().

Also, the conn->cause is needed to move message dispatch to an "onenter"
function in patch I234b2a754d0c98031056981823cdbc187e977741. I Split
this part off as a separate patch for better readability.

Related: OS#5337
Change-Id: Ib6432746040899129d1d73ae8dc59add2d88a915
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
2 files changed, 7 insertions(+), 3 deletions(-)



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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 238b2f7..4e26ec1 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -404,6 +404,8 @@
 		bool last_eutran_plmn_valid; /* Is information stored in field below available? */
 		struct osmo_plmn_id last_eutran_plmn;
 	} fast_return;
+
+	enum gsm0808_cause clear_cause;
 };
 
 
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 2140c9b..ff742a2 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -144,6 +144,7 @@
 
 	struct msgb *resp;
 	int rc;
+	conn->clear_cause = cause;
 
 	if (conn->rx_clear_command) {
 		LOGPFSML(conn->fi, LOGL_DEBUG, "Not sending BSSMAP CLEAR REQUEST, already got CLEAR COMMAND from MSC\n");
@@ -976,9 +977,7 @@
 	}
 
 	LOGPFSML(fi, LOGL_DEBUG, "Releasing all lchans (if any) because this conn is terminating\n");
-	/* when things go smoothly, the lchan should have been released before FSM instance termination. So if this is
-	 * necessary it's probably "abnormal". */
-	gscon_release_lchans(conn, true, GSM48_RR_CAUSE_ABNORMAL_UNSPEC);
+	gscon_release_lchans(conn, true, bsc_gsm48_rr_cause_from_gsm0808_cause(conn->clear_cause));
 
 	/* drop pending messages */
 	gscon_dtap_queue_flush(conn, 0);
@@ -1057,6 +1056,9 @@
 	INIT_LLIST_HEAD(&conn->hodec2.penalty_timers);
 	conn->sccp.conn_id = -1;
 
+	/* Default clear cause (on RR translates to GSM48_RR_CAUSE_ABNORMAL_UNSPEC) */
+	conn->clear_cause = GSM0808_CAUSE_EQUIPMENT_FAILURE;
+
 	/* don't allocate from 'conn' context, as gscon_cleanup() will call talloc_free(conn) before
 	 * libosmocore will call talloc_free(conn->fi), i.e. avoid use-after-free during cleanup */
 	conn->fi = osmo_fsm_inst_alloc(&gscon_fsm, net, conn, LOGL_DEBUG, NULL);

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib6432746040899129d1d73ae8dc59add2d88a915
Gerrit-Change-Number: 26612
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211217/cc63e7d5/attachment.htm>


More information about the gerrit-log mailing list