aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-24 17:38:04 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-09-24 17:38:53 +0200
commit8b7421267e374ca8b31a06ad31ff66bdbf98a185 (patch)
tree48037e5d8a79d3fbe94c660b76f5b1f254bdee15
parent67e47c6076fea691345d594977e354538d50566b (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
-rw-r--r--src/osmo-bsc/assignment_fsm.c16
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..1c4e6fdfc 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) */
lcls_apply_config(conn);
- 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);
return;
-
- /* 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. */