From 539e630eda8bf51586a885d970937d355d86bfe4 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 22 Jun 2020 03:11:54 +0700 Subject: MSC_ConnectionHandler: fix race condition in f_establish_fully() For more details, see I25e10e28de174337233e6a3bb32cc16f2d7d614e. Change-Id: Icdb4f2e0edc4cb6e2010a9299331e7e93d0ca007 Related: OS#4619 --- bsc/MSC_ConnectionHandler.ttcn | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 8ac70512..0d4c81b6 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); -- cgit v1.2.3