fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42592?usp=email )
Change subject: lchan_fsm: don't mark lchan as BORKEN on unsupported mode NACK
......................................................................
lchan_fsm: don't mark lchan as BORKEN on unsupported mode NACK
When the BTS NACKs a Channel Activation with RSL_ERR_SERV_OPT_UNAVAIL
or RSL_ERR_SERV_OPT_UNIMPL, it means the requested service or channel
mode is not supported - not that the hardware is broken. In this
case the lchan should transition to LCHAN_ST_WAIT_AFTER_ERROR rather
than LCHAN_ST_BORKEN, which is reserved for genuine hardware failures.
Also add LCHAN_EV_RTP_ERROR to LCHAN_ST_WAIT_AFTER_ERROR's in_event_mask
so that a late LCHAN_EV_RTP_ERROR (e.g. MGCP CRCX timeout arriving after
the NACK was already handled) is silently absorbed rather than triggering
an unexpected-event warning.
Change-Id: Ide3830a697501a0c245a41451302f1e68d553b3c
Related: osmo-ttcn3-hacks.git I000b7b44749380c5af4da42abe37b4ada6e06ee4
Related: OS#6324
---
M src/osmo-bsc/lchan_fsm.c
1 file changed, 14 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/42592/1
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 524d66e..afb5cc8 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -977,12 +977,22 @@
lchan->release.rsl_error_cause = *(uint8_t*)data;
lchan->release.rr_cause = bsc_gsm48_rr_cause_from_rsl_cause(lchan->release.rsl_error_cause);
lchan->release.in_error = true;
- if (lchan->release.rsl_error_cause != RSL_ERR_RCH_ALR_ACTV_ALLOC)
- next_state = LCHAN_ST_BORKEN;
- else
+ switch (lchan->release.rsl_error_cause) {
+ case RSL_ERR_RCH_ALR_ACTV_ALLOC:
/* Taking this over from legacy code: send an RF Chan Release even though
* the Activ was NACKed. Is this really correct? */
next_state = LCHAN_ST_WAIT_RF_RELEASE_ACK;
+ break;
+ case RSL_ERR_SERV_OPT_UNAVAIL:
+ case RSL_ERR_SERV_OPT_UNIMPL:
+ /* BTS does not support the requested service or mode; the lchan
+ * itself is not broken, so don't mark it as such. */
+ next_state = LCHAN_ST_WAIT_AFTER_ERROR;
+ break;
+ default:
+ next_state = LCHAN_ST_BORKEN;
+ break;
+ }
lchan_fail_to(next_state, "Chan Activ NACK: %s (0x%x)",
rsl_err_name(lchan->release.rsl_error_cause), lchan->release.rsl_error_cause);
@@ -1759,6 +1769,7 @@
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
| S(LCHAN_ST_WAIT_RLL_RTP_ESTABLISH)
+ | S(LCHAN_ST_WAIT_AFTER_ERROR)
| S(LCHAN_ST_BORKEN)
| S(LCHAN_ST_WAIT_RF_RELEASE_ACK)
,
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42592?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ide3830a697501a0c245a41451302f1e68d553b3c
Gerrit-Change-Number: 42592
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42587?usp=email )
Change subject: ipaccess: fix buffer overread in ipacc_parse_supp_flags()
......................................................................
ipaccess: fix buffer overread in ipacc_parse_supp_flags()
The loop used OSMO_MAX(e->len, 4), which iterates at least 4 times
even when the IE is shorter than 4 bytes, causing a buffer overread.
Replace with OSMO_MIN(e->len, sizeof(u32)) to cap the iteration both
at the actual IE length and at the uint32_t accumulator size.
Change-Id: I97c69a71eb650cbef1cc3652d0a2a966cfd6cf60
---
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/87/42587/1
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index 23196fc..a197a79 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -47,7 +47,7 @@
{
uint32_t u32 = 0;
- for (unsigned int i = 0; i < OSMO_MAX(e->len, 4); i++)
+ for (unsigned int i = 0; i < OSMO_MIN(e->len, sizeof(u32)); i++)
u32 |= e->val[i] << (i * 8);
for (const struct value_string *vs = flags; vs->value && vs->str; vs++) {
if (u32 & vs->value)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42587?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I97c69a71eb650cbef1cc3652d0a2a966cfd6cf60
Gerrit-Change-Number: 42587
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42582?usp=email )
Change subject: bsc: verify Cell ID in BSSMAP HandoverPerformed
......................................................................
bsc: verify Cell ID in BSSMAP HandoverPerformed
As per 3GPP TS 48.008 §3.2.1.25, HANDOVER PERFORMED must report the
target cell. Add an optional cell_id parameter to the template
(defaulting to '?' for backward compatibility) and update the two
intra-BSC handover test helpers to assert that the Cell Identifier
IE carries the target BTS (BTS 1: MCC=001 MNC=01 LAC=1 CI=1).
Also remove the unnecessary interleave wrapper in
f_tc_ho_during_lcs_loc_req(): the two receives arrive on separate
ports (RAN_CONN vs BSSAP_LE) so sequential receive is sufficient.
Change-Id: I82aadcc3a80c183cb93522b829071294b156a218
Related: osmo-bsc.git I4111351dc38fc2dbe844c2bd07b3ecfaaadd864e
---
M bsc/BSC_Tests.ttcn
M library/BSSMAP_Templates.ttcn
2 files changed, 21 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/42582/1
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index e97ecb0..a4c666e 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -5887,8 +5887,14 @@
}
/* Since this is an internal handover we expect the BSC to inform the
- * MSC about the event */
- RAN_CONN.receive(tr_BSSMAP_HandoverPerformed);
+ * MSC about the event. The Cell Identifier must report the *target* BTS
+ * (BTS 1: MCC=001 MNC=01 LAC=1 CI=1), not the source BTS. */
+ alt {
+ [] RAN_CONN.receive(tr_BSSMAP_HandoverPerformed(tr_CellId_CGI('00F110'O, 1, 1)));
+ [] RAN_CONN.receive(tr_BSSMAP_HandoverPerformed) {
+ setverdict(fail, "BSSMAP HandoverPerformed indicates unexpected Cell ID");
+ }
+ }
/* Check the amount of MGCP transactions is still consistant with the
* test expectation */
@@ -10855,17 +10861,21 @@
[] as_handover(hs);
}
+ /* Expect the BSC to inform the MSC about the handover. The Cell Identifier
+ * must report the *target* BTS (BTS 1: MCC=001 MNC=01 LAC=1 CI=1). */
+ alt {
+ [] RAN_CONN.receive(tr_BSSMAP_HandoverPerformed(tr_CellId_CGI('00F110'O, 1, 1)));
+ [] RAN_CONN.receive(tr_BSSMAP_HandoverPerformed) {
+ setverdict(fail, "BSSMAP HandoverPerformed indicates unexpected Cell ID");
+ }
+ }
+
var PDU_BSSAP_LE rx_bsslap;
- interleave {
- /* Expect the BSC to inform the MSC about the handover */
- [] RAN_CONN.receive(tr_BSSMAP_HandoverPerformed);
-
/* Expect the BSC to inform the SMLC about the handover */
- [] BSSAP_LE.receive(tr_BSSMAP_LE_ConnInfo(BSSMAP_LE_PROT_BSSLAP, ?)) -> value(rx_bsslap) {
+ BSSAP_LE.receive(tr_BSSMAP_LE_ConnInfo(BSSMAP_LE_PROT_BSSLAP, ?)) -> value(rx_bsslap) {
f_match_bsslap(rx_bsslap, tr_BSSLAP_Reset(BSSLAP_CAUSE_INTRA_BSS_HO));
}
- }
/* SMLC now responds with geo information data. */
BSSAP_LE.send(ts_BSSMAP_LE_PerfLocResp(gad_ell_point_unc_circle, omit));
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 563d6d1..deeabda 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -1331,14 +1331,15 @@
}
}
-template PDU_BSSAP tr_BSSMAP_HandoverPerformed
+template PDU_BSSAP
+tr_BSSMAP_HandoverPerformed(template (present) BSSMAP_IE_CellIdentifier cell_id := ?)
modifies tr_BSSAP_BSSMAP := {
pdu := {
bssmap := {
handoverPerformed := {
messageType := '17'O,
cause := ?,
- cellIdentifier := ?,
+ cellIdentifier := cell_id,
chosenChannel := *,
chosenEncryptionAlgorithm := *,
speechVersion := *,
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42582?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I82aadcc3a80c183cb93522b829071294b156a218
Gerrit-Change-Number: 42582
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>