summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-27 16:52:56 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-27 15:33:27 +0000
commitd5833a8dcc1d9c38c4271f4522b27214009cb073 (patch)
tree6d1d473d00c1d12f3b6358529fdb6e8175d5d1f5
parent710ec2154f6986655f1cd98cc2213ab603c6f03f (diff)
BSSAP_Adapter: Split f_bssap_start() from f_bssap_init()
In non-handler mode, the SCCP emulation is currently started before there's a user registered to SCCP_SP_PORT. If the first BSSMAP package arrives from the network, then the SCCP_Emulation will crash as it cannot deliver the resulting SCCP user primitive to the user. Let's split start from initialization, so user code can still register something to SCCP_SP_PORT before starting SCCP_Emulation. Change-Id: I55c94f18531bb7e5369500dc90f4b0ff3a420774
-rw-r--r--bsc/BSC_Tests.ttcn2
-rw-r--r--library/BSSAP_Adapter.ttcn5
-rw-r--r--msc/MSC_Tests.ttcn1
3 files changed, 7 insertions, 1 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 936544b..906e214 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -312,6 +312,8 @@ function f_init(integer nr_bts := NUM_BTS, boolean handler_mode := false) runs o
connect(self:BSSAP, g_bssap.vc_SCCP:SCCP_SP_PORT);
f_legacy_bssap_reset();
}
+ f_bssap_start(g_bssap);
+
f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
f_init_mgcp("VirtMSC");
diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn
index 7f03f33..e50487d 100644
--- a/library/BSSAP_Adapter.ttcn
+++ b/library/BSSAP_Adapter.ttcn
@@ -164,9 +164,12 @@ function f_bssap_init(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg, charst
ba.vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), ""));
}
- ba.vc_SCCP.start(SCCPStart(ba.sccp_pars));
}
+function f_bssap_start(inout BSSAP_Adapter ba) {
+ ba.vc_SCCP.start(SCCPStart(ba.sccp_pars));
+}
+
}
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 56ac3d3..f843839 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -228,6 +228,7 @@ function f_init(integer num_bsc := 1) runs on MTC_CT {
for (var integer i := 0; i < num_bsc; i := i + 1) {
if (isbound(mp_bssap_cfg[i])) {
f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps);
+ f_bssap_start(g_bssap[i]);
} else {
setverdict(fail, "missing BSSAP configuration");
}