aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-04-07 04:34:48 +0200
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-04-07 04:55:48 +0200
commitf88f539c775f269101bb0d8b87fd0560f367f639 (patch)
tree0994b5004e2e060d9c1935ddc94aa12b1eb5a13d
parent2915bbf4c551468ae911de61eda8520bd2f8f422 (diff)
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
-rw-r--r--src/common/l1sap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index b8bfa310..7702b233 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1962,16 +1962,16 @@ static int l1sap_chan_act_dact_modify(struct gsm_bts_trx *trx, uint8_t chan_nr,
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)