sgsn: Fix regression regarding g_pars.bssgp.cell_id[] array overflow
This was introduced in I7d859fd710dba96eb9b46c428243281183e1be12
and caused Iu related TTCN3 tests to fail with:
SGSN_Tests.ttcn:771 Dynamic test case error: Index overflow in a value of type @SGSN_Tests.BssgpCellIds: The index is 3, but the value has only 3 elements.
Change-Id: Iaae0015f5e7c7eabc426add91b5de1b63bf6d9f6
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index c6e22cc..b79aae4 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -768,7 +768,9 @@
function f_process_attach_accept(PDU_GMM_AttachAccept aa, integer ran_index := 0) runs on BSSGP_ConnHdlr {
/* mandatory IE */
var hexstring aa_plmn := f_RAI_to_plmn_hexstr(aa.routingAreaIdentification);
- if (not (g_pars.bssgp_cell_id[ran_index].ra_id.lai.mcc_mnc == aa_plmn)) {
+ /* we cannot use ran_index here, as it would overflow the cell_id object, since ran_idx > NUM_GB
+ * indicates an Iu RAN connection. All cells are expected to run the same MCC/MNC anyway... */
+ if (not (g_pars.bssgp_cell_id[0].ra_id.lai.mcc_mnc == aa_plmn)) {
setverdict(fail, "mismatching PLMN in Attach Accept: " & hex2str(aa_plmn)
& "; expected " & hex2str(g_pars.bssgp_cell_id[ran_index].ra_id.lai.mcc_mnc));
mtc.stop;