summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-06-22 03:11:54 +0700
committerlaforge <laforge@osmocom.org>2020-06-21 20:46:49 +0000
commit539e630eda8bf51586a885d970937d355d86bfe4 (patch)
tree5017165d6149fcd51a1bdc02f0d6262ba691706d
parente9c0635dae253c4d1d7837c3b577008671e30052 (diff)
MSC_ConnectionHandler: fix race condition in f_establish_fully()
-rw-r--r--bsc/MSC_ConnectionHandler.ttcn12
1 files changed, 12 insertions, 0 deletions
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 8ac7051..0d4c81b 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -801,6 +801,9 @@ altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr {
/* register our component for this channel number at the RSL Emulation */
f_rslem_register(0, new_chan_nr);
+ /* dispatch queued messages for this channel (if any) */
+ f_rslem_dchan_queue_dispatch();
+
var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_AssignmentComplete('00'O));
/* send assignment complete over the new channel */
RSL.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)),
@@ -1093,6 +1096,15 @@ runs on MSC_ConnHdlr {
g_media.mgcp_conn[1].mdcx_seen_exp := 0;
}
+ /* On receipt of the BSSAP Assignment Command, the IUT (osmo-bsc) will allocate
+ * a channel and send us RR Assignment Command together with ip.access CRCX.
+ * There is a risk that the RSL Emulation component would dequeue and process
+ * ip.access CRCX faster than we process the Assignment Command and register
+ * the corresponding handler for the indicated RSL channel number. This would
+ * result in a failure, because at that moment there will be no handler for
+ * ip.access CRCX. Let's guard against this and enable additional queueing. */
+ f_rslem_dchan_queue_enable();
+
f_create_mgcp_expect(mgcpcrit);
BSSAP.send(ass_cmd);