<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/21710">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">si2quater: fix budget calculation for multiple EARFCNs<br><br>In rest_octets.c append_earfcn(), the unconditional bits added are 40, not 25.<br>Removing only 25 bits from the budget resulted in malformed SI2quater starting<br>with 4 configured EARFCNs, by adding more EARFCNs than fit in 20 bits.<br><br>These malformed SI2quater were also expected in gsm0408_test.c. Update the<br>expected SI2quater to what is being generated now. This patch passes the ttcn3<br>testing added in I45382f88686ca60e68569e93569fc4cfb63a0e0d, which provides some<br>confidence that the coding expected in gsm0408_test.c is now correct.<br><br>This commit is a cherry-pick of osmo-bsc.git 6589f7c3a8dfdaaf66dda3afa6bbb1118ec825f9<br><br>Change-Id: Icc1ece39ad162d09720e104c5cbc12b07d6771a8<br>Related: OS#4652<br>---<br>M src/gsm/gsm48_rest_octets.c<br>1 file changed, 9 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm/gsm48_rest_octets.c b/src/gsm/gsm48_rest_octets.c</span><br><span>index 84b7589..5c7d77a 100644</span><br><span>--- a/src/gsm/gsm48_rest_octets.c</span><br><span>+++ b/src/gsm/gsm48_rest_octets.c</span><br><span>@@ -165,7 +165,7 @@</span><br><span> {</span><br><span>   bool appended;</span><br><span>       unsigned int old = bv->cur_bit; /* save current position to make rollback possible */</span><br><span style="color: hsl(0, 100%, 40%);">-        int rem = budget - 25;</span><br><span style="color: hsl(120, 100%, 40%);">+        int rem = ((int)budget) - 40;</span><br><span>        if (rem <= 0)</span><br><span>             return;</span><br><span> </span><br><span>@@ -193,6 +193,8 @@</span><br><span>    /* Priority and E-UTRAN Parameters Description */</span><br><span>    bitvec_set_bit(bv, 1);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    /* budget: 10 bits used above */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   /* Serving Cell Priority Parameters Descr. is Present,</span><br><span>       * see also: 3GPP TS 44.018, Table 10.5.2.33b.1 */</span><br><span>    bitvec_set_bit(bv, 1);</span><br><span>@@ -212,6 +214,8 @@</span><br><span>         /* T_Reselection */</span><br><span>  bitvec_set_uint(bv, 0, 2);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        /* budget: 26 bits used above */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   /* No 3G Priority Parameters Description */</span><br><span>  bitvec_set_bit(bv, 0);</span><br><span>       /* E-UTRAN Parameters Description */</span><br><span>@@ -235,12 +239,16 @@</span><br><span>         /* Repeated E-UTRAN Neighbour Cells */</span><br><span>       bitvec_set_bit(bv, 1);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    /* budget: 34 bits used above */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   appended = append_eutran_neib_cell(bv, e, e_offset, rem);</span><br><span>    if (!appended) { /* appending is impossible within current budget: rollback */</span><br><span>               bv->cur_bit = old;</span><br><span>                return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* budget: further 6 bits used below, totalling 40 bits */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */</span><br><span>   bitvec_set_bit(bv, 0);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/21710">change 21710</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/libosmocore/+/21710"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icc1ece39ad162d09720e104c5cbc12b07d6771a8 </div>
<div style="display:none"> Gerrit-Change-Number: 21710 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>