<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/23673">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">l1sap: fix wrong IEI and parsing in l1sap_chan_act()<br><br>As the prefix in 'GSM48_IE_CHANDESC_2' implies, this IE belongs<br>to 3GPP TS 04.08 (or TS 44.018), so it can be used in the Radio<br>Resource assignment messages sent to the MS.  While in this<br>function we're dealing with 3GPP TS 48.058, and thus the IEI<br>may be (and actually is) different for the RSL messages.<br><br>Also, according to 3GPP TS 48.058, section 9.3.5, the Channel<br>Description IE is included together with its element identifier,<br>so we need to skip one byte when doing the pointer casting.<br><br>Change-Id: Id100f4c56fd5c1adad5d925d97240bed82981b9b<br>Related: SYS#4895, OS#4941<br>---<br>M src/common/l1sap.c<br>1 file changed, 4 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/73/23673/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/l1sap.c b/src/common/l1sap.c</span><br><span>index b8bfa31..7702b23 100644</span><br><span>--- a/src/common/l1sap.c</span><br><span>+++ b/src/common/l1sap.c</span><br><span>@@ -1962,16 +1962,16 @@</span><br><span> int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp)</span><br><span> {</span><br><span>      struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);</span><br><span style="color: hsl(0, 100%, 40%);">-   struct gsm48_chan_desc *cd;</span><br><span style="color: hsl(120, 100%, 40%);">+   const struct gsm48_chan_desc *cd;</span><br><span>    int rc;</span><br><span> </span><br><span>  LOGPLCHAN(lchan, DL1C, LOGL_INFO, "activating channel %s\n", rsl_chan_nr_str(chan_nr));</span><br><span> </span><br><span>        /* osmo-pcu calls this without a valid 'tp' parameter, so we</span><br><span>          * need to make sure ew don't crash here */</span><br><span style="color: hsl(0, 100%, 40%);">- if (tp && TLVP_PRES_LEN(tp, GSM48_IE_CHANDESC_2, sizeof(*cd))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                cd = (struct gsm48_chan_desc *)</span><br><span style="color: hsl(0, 100%, 40%);">-         TLVP_VAL(tp, GSM48_IE_CHANDESC_2);</span><br><span style="color: hsl(120, 100%, 40%);">+    if (tp && TLVP_PRES_LEN(tp, RSL_IE_CHAN_IDENT, sizeof(*cd) + 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+            /* Channel Description IE comes together with its IEI (see 9.3.5) */</span><br><span style="color: hsl(120, 100%, 40%);">+          cd = (const struct gsm48_chan_desc *) TLVP_VAL(tp, RSL_IE_CHAN_IDENT) + 1;</span><br><span> </span><br><span>               /* The PHY may not support using different TSCs */</span><br><span>           if (!osmo_bts_has_feature(trx->bts->features, BTS_FEAT_MULTI_TSC)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/23673">change 23673</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/23673"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id100f4c56fd5c1adad5d925d97240bed82981b9b </div>
<div style="display:none"> Gerrit-Change-Number: 23673 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>