<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/23787">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">l1sap: fix incorrect pointer cast in l1sap_chan_act()<br><br>In [1] I introduced a regression, so osmo-bts started to complain:<br><br>  This PHY does not support lchan TSC 3 != BSIC-TSC 7<br><br>on channel activation, despite the TSC in RSL_IE_CHAN_IDENT was 7.<br><br>The problem is that this statement:<br><br>  cd = (const struct gsm48_chan_desc *) TLVP_VAL(tp, RSL_IE_CHAN_IDENT) + 1;<br><br>is basically equivalent to:<br><br>  cd = ((const struct gsm48_chan_desc *) TLVP_VAL(tp, RSL_IE_CHAN_IDENT)) + 1;<br><br>so we actually shift the pointer by sizeof(struct gsm48_chan_desc)<br>and skip 3 octets instead of just one (IEI octet).  Fix this.<br><br>Change-Id: Ic3a81396b60577e03c541d32839d07dc6d45c838<br>Fixes: [1] Id100f4c56fd5c1adad5d925d97240bed82981b9b<br>Fixes: OS#5121<br>---<br>M src/common/l1sap.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/23787/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 7702b23..b74e0d3 100644</span><br><span>--- a/src/common/l1sap.c</span><br><span>+++ b/src/common/l1sap.c</span><br><span>@@ -1971,7 +1971,7 @@</span><br><span>       * need to make sure ew don't crash here */</span><br><span>      if (tp && TLVP_PRES_LEN(tp, RSL_IE_CHAN_IDENT, sizeof(*cd) + 1)) {</span><br><span>           /* Channel Description IE comes together with its IEI (see 9.3.5) */</span><br><span style="color: hsl(0, 100%, 40%);">-            cd = (const struct gsm48_chan_desc *) TLVP_VAL(tp, RSL_IE_CHAN_IDENT) + 1;</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/+/23787">change 23787</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/+/23787"/><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: Ic3a81396b60577e03c541d32839d07dc6d45c838 </div>
<div style="display:none"> Gerrit-Change-Number: 23787 </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>