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
This commit is contained in:
Vadim Yanitskiy 2021-04-07 04:34:48 +02:00
parent 2915bbf4c5
commit f88f539c77
1 changed files with 4 additions and 4 deletions

View File

@ -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)