path: root/src
diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-24 17:38:04 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-26 17:42:37 +0000
commitbeb74814bf228b413cbb4e8c92be6394cc87851f (patch)
treeb0b13988afbe059b197d9c9dfa40fc22524bafda /src
parent0d4a98ae24eb0369605cce857284343e52de8df2 (diff)
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
Diffstat (limited to 'src')
1 files changed, 10 insertions, 6 deletions
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 5304d6c88..a7564e0cd 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -200,18 +200,22 @@ static void send_assignment_complete(struct gsm_subscriber_connection *conn, str
static void assignment_success(struct gsm_subscriber_connection *conn)
+ /* Take on the new lchan */
+ gscon_change_primary_lchan(conn, conn->assignment.new_lchan);
+ conn->assignment.new_lchan = NULL;
/* apply LCLS configuration (if any) */
- send_assignment_complete(conn, conn->assignment.new_lchan);
+ 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)
+ 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);
- /* Take on the new lchan */
- gscon_change_primary_lchan(conn, conn->assignment.new_lchan);
- conn->assignment.new_lchan = NULL;
+ }
/* 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. */