aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/msc_a.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-04-24 23:37:07 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-05-04 23:43:11 +0200
commit5d53c6001dc3af457aa32de59ed5fc31d71fcce7 (patch)
treed89720782d6773ccb4680664a9a95e8b3a2eff12 /src/libmsc/msc_a.c
parentc628c9e25646395a4a6045a1071672e77a95f4c1 (diff)
fix crash on CM Serv Rej: fix use count mismatch
With comments, clarify the code paths where a CM Service use count has not yet been placed on the conn (just send CM Service Reject) and where the use count is placed (decrement count on CM Service Reject). Place the CM Service use count slightly earlier: - it is then correctly present when checking the mobile identity in cm_serv_reuse_conn(), avoiding the crash reported in OS#5532. - there is only one place incrementing the use count instead of two. Related: OS#5532 Change-Id: I6c735b79b67108bcaadada3f01c7046e262f939b
Diffstat (limited to 'src/libmsc/msc_a.c')
-rw-r--r--src/libmsc/msc_a.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index e2bf975ca..5761ed773 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1792,6 +1792,10 @@ int msc_a_try_call_assignment(struct gsm_trans *cc_trans)
return msc_a_start_assignment(msc_a, cc_trans);
}
+/* Map CM Service type to use token.
+ * Given a CM Service type, return a matching token intended for osmo_use_count.
+ * For unknown service type, return NULL.
+ */
const char *msc_a_cm_service_type_to_use(enum osmo_cm_service_type cm_service_type)
{
switch (cm_service_type) {