Change in osmo-bts[master]: l1sap: fix wrong IEI and parsing in l1sap_chan_act()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Apr 7 13:34:55 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/23673 )


Change subject: l1sap: fix wrong IEI and parsing in l1sap_chan_act()
......................................................................

l1sap: fix wrong IEI and parsing in l1sap_chan_act()

As the prefix in 'GSM48_IE_CHANDESC_2' implies, this IE belongs
to 3GPP TS 04.08 (or TS 44.018), so it can be used in the Radio
Resource assignment messages sent to the MS.  While in this
function we're dealing with 3GPP TS 48.058, and thus the IEI
may be (and actually is) different for the RSL messages.

Also, according to 3GPP TS 48.058, section 9.3.5, the Channel
Description IE is included together with its element identifier,
so we need to skip one byte when doing the pointer casting.

Change-Id: Id100f4c56fd5c1adad5d925d97240bed82981b9b
Related: SYS#4895, OS#4941
---
M src/common/l1sap.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/73/23673/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index b8bfa31..7702b23 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1962,16 +1962,16 @@
 int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp)
 {
 	struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
-	struct gsm48_chan_desc *cd;
+	const struct gsm48_chan_desc *cd;
 	int rc;
 
 	LOGPLCHAN(lchan, DL1C, LOGL_INFO, "activating channel %s\n", rsl_chan_nr_str(chan_nr));
 
 	/* osmo-pcu calls this without a valid 'tp' parameter, so we
 	 * need to make sure ew don't crash here */
-	if (tp && TLVP_PRES_LEN(tp, GSM48_IE_CHANDESC_2, sizeof(*cd))) {
-		cd = (struct gsm48_chan_desc *)
-		TLVP_VAL(tp, GSM48_IE_CHANDESC_2);
+	if (tp && TLVP_PRES_LEN(tp, RSL_IE_CHAN_IDENT, sizeof(*cd) + 1)) {
+		/* Channel Description IE comes together with its IEI (see 9.3.5) */
+		cd = (const struct gsm48_chan_desc *) TLVP_VAL(tp, RSL_IE_CHAN_IDENT) + 1;
 
 		/* The PHY may not support using different TSCs */
 		if (!osmo_bts_has_feature(trx->bts->features, BTS_FEAT_MULTI_TSC)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/23673
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id100f4c56fd5c1adad5d925d97240bed82981b9b
Gerrit-Change-Number: 23673
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210407/9391be04/attachment.htm>


More information about the gerrit-log mailing list