Change in osmo-bsc[master]: fix LCLS during Assignment: actually use new TCH lchan

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
Wed Sep 26 08:18:48 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/11098


Change subject: fix LCLS during Assignment: actually use new TCH lchan
......................................................................

fix LCLS during Assignment: actually use new TCH lchan

In assignment_success(), don't trigger lcls_apply_config() before the
conn->lchan points at the actual new voice lchan. The entire LCLS code relies
on conn->lchan.

The assignment FSM wants to point conn->lchan to the new lchan only after it is
sure that sending the Assignment Complete to the MSC was successful. However, a
failure is a) very unlikely and b) if sending to the MSC fails we might as well
tear the whole conn down anyway. Now, if sending to the MSC fails, release the
lchan and the conn should clean itself up.

Related: OS#1602
Change-Id: I8dd561d744d8081b5ac5ffa7635f17ac19bcda45
---
M src/osmo-bsc/assignment_fsm.c
1 file changed, 13 insertions(+), 9 deletions(-)



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

diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 5304d6c..a7564e0 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -200,19 +200,23 @@
 
 static void assignment_success(struct gsm_subscriber_connection *conn)
 {
-	/* apply LCLS configuration (if any) */
-	lcls_apply_config(conn);
-
-	send_assignment_complete(conn, conn->assignment.new_lchan);
-	/* If something went wrong during send_assignment_complete(), the fi will be gone from
-	 * error handling in there. Almost a success, but then again the whole thing failed. */
-	if (!conn->assignment.fi)
-		return;
-
 	/* Take on the new lchan */
 	gscon_change_primary_lchan(conn, conn->assignment.new_lchan);
 	conn->assignment.new_lchan = NULL;
 
+	/* apply LCLS configuration (if any) */
+	lcls_apply_config(conn);
+
+	send_assignment_complete(conn, conn->lchan);
+	/* If something went wrong during send_assignment_complete(), the fi will be gone from
+	 * error handling in there. Almost a success, but then again the whole thing failed. */
+	if (!conn->assignment.fi) {
+		/* The lchan was ready, and we failed to tell the MSC about it. By releasing this lchan,
+		 * the conn will notice that its primary lchan is gone and should clean itself up. */
+		lchan_release(conn->lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+		return;
+	}
+
 	/* Rembered this only for error handling: should assignment fail, assignment_reset() will release
 	 * the MGW endpoint right away. If successful, the conn continues to use the endpoint. */
 	conn->assignment.created_ci_for_msc = NULL;

-- 
To view, visit https://gerrit.osmocom.org/11098
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: I8dd561d744d8081b5ac5ffa7635f17ac19bcda45
Gerrit-Change-Number: 11098
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180926/6326ff05/attachment.htm>


More information about the gerrit-log mailing list