Change in osmo-bsc[master]: subscr conn: properly forget lchan before release

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 Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Oct 11 15:15:23 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/11311


Change subject: subscr conn: properly forget lchan before release
......................................................................

subscr conn: properly forget lchan before release

Clear all lchan->conn pointers when the subscr conn code is choosing to release
an lchan, with gscon_release_lchan().

Rationale: when an lchan releases in error, it should trigger the conn to be
notified and cause a BSSMAP Clear. However, if the conn is actively requesting
for an lchan release, it is already taking care of the situation.

Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154
Change-Id: I4fd582b41ba4599af704d670af83651d2450b1db
---
M src/osmo-bsc/bsc_subscr_conn_fsm.c
1 file changed, 22 insertions(+), 8 deletions(-)



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

diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index a8b3183..52afd54 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -149,6 +149,24 @@
 	gscon_sigtran_send(conn, resp);
 }
 
+
+/* Release an lchan in such a way that it doesn't fire events back to the conn. */
+static void gscon_release_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan,
+				bool do_sacch_deact, bool err, enum gsm48_rr_cause cause_rr)
+{
+	if (!lchan || !conn)
+		return;
+	if (lchan->conn == conn)
+		lchan_forget_conn(lchan);
+	if (conn->lchan == lchan)
+		conn->lchan = NULL;
+	if (conn->ho.fi && conn->ho.new_lchan == lchan)
+		conn->ho.new_lchan = NULL;
+	if (conn->assignment.new_lchan == lchan)
+		conn->assignment.new_lchan = NULL;
+	lchan_release(lchan, do_sacch_deact, err, cause_rr);
+}
+
 void gscon_release_lchans(struct gsm_subscriber_connection *conn, bool do_sacch_deact)
 {
 	if (conn->ho.fi)
@@ -156,9 +174,7 @@
 
 	assignment_reset(conn);
 
-	lchan_release(conn->lchan, do_sacch_deact, false, 0);
-	lchan_forget_conn(conn->lchan);
-	conn->lchan = NULL;
+	gscon_release_lchan(conn, conn->lchan, do_sacch_deact, false, 0);
 }
 
 static void handle_bssap_n_connect(struct osmo_fsm_inst *fi, struct osmo_scu_prim *scu_prim)
@@ -602,10 +618,8 @@
 	if (conn->lchan->fi_rtp)
 		osmo_fsm_inst_dispatch(conn->lchan->fi_rtp, LCHAN_RTP_EV_ESTABLISHED, 0);
 
-	if (old_lchan && (old_lchan != new_lchan)) {
-		lchan_forget_conn(old_lchan);
-		lchan_release(old_lchan, false, false, 0);
-	}
+	if (old_lchan && (old_lchan != new_lchan))
+		gscon_release_lchan(conn, old_lchan, false, false, 0);
 }
 
 void gscon_lchan_releasing(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan)
@@ -769,7 +783,7 @@
 
 	switch (fi->T) {
 	case 993210:
-		lchan_release(conn->lchan, false, true, RSL_ERR_INTERWORKING);
+		gscon_release_lchan(conn, conn->lchan, false, true, RSL_ERR_INTERWORKING);
 
 		/* MSC has not responded/confirmed connection with CC, this
 		 * could indicate a bad SCCP connection. We now inform the the

-- 
To view, visit https://gerrit.osmocom.org/11311
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fd582b41ba4599af704d670af83651d2450b1db
Gerrit-Change-Number: 11311
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181011/cdd8ffe1/attachment.htm>


More information about the gerrit-log mailing list