<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/24706">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">oml: fix handling of NM_ATT_INTERF_BOUND attribute<br><br>Looks like this part of the code has never been tested.  The old<br>code would dereference the same value in the loop and assign it<br>to all members in array 'bts->interference.boundary'.<br><br>Let's simply memcpy() the contents of NM_ATT_INTERF_BOUND as is,<br>i.e. 6 unsigned values encoded as -x dBm.<br><br>Change-Id: I7f83d8e6eb6cc19e3e9529ba06617a902de23e35<br>Related: SYS#5313, OS#1569<br>---<br>M include/osmo-bts/bts.h<br>M src/common/oml.c<br>2 files changed, 5 insertions(+), 6 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/06/24706/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h</span><br><span>index 978a548..0e04788 100644</span><br><span>--- a/include/osmo-bts/bts.h</span><br><span>+++ b/include/osmo-bts/bts.h</span><br><span>@@ -234,7 +234,7 @@</span><br><span> </span><br><span>      struct {</span><br><span>             /* Interference Boundaries for OML */</span><br><span style="color: hsl(0, 100%, 40%);">-           int16_t boundary[6];</span><br><span style="color: hsl(120, 100%, 40%);">+          uint8_t boundary[6];</span><br><span>                 uint8_t intave;</span><br><span>      } interference;</span><br><span>      unsigned int t200_ms[7];</span><br><span>diff --git a/src/common/oml.c b/src/common/oml.c</span><br><span>index 8b84f85..b99f3d4 100644</span><br><span>--- a/src/common/oml.c</span><br><span>+++ b/src/common/oml.c</span><br><span>@@ -584,11 +584,10 @@</span><br><span> </span><br><span>    /* 9.4.25 Interference Level Boundaries */</span><br><span>   if (TLVP_PRES_LEN(&tp, NM_ATT_INTERF_BOUND, 6)) {</span><br><span style="color: hsl(0, 100%, 40%);">-           payload = TLVP_VAL(&tp, NM_ATT_INTERF_BOUND);</span><br><span style="color: hsl(0, 100%, 40%);">-               for (i = 0; i < 6; i++) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    int16_t boundary = *payload;</span><br><span style="color: hsl(0, 100%, 40%);">-                    bts->interference.boundary[i] = -1 * boundary;</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Copy the values as is, in -x dBm */</span><br><span style="color: hsl(120, 100%, 40%);">+                memcpy(&bts->interference.boundary[0],</span><br><span style="color: hsl(120, 100%, 40%);">+                TLVP_VAL(&tp, NM_ATT_INTERF_BOUND),</span><br><span style="color: hsl(120, 100%, 40%);">+                       sizeof(bts->interference.boundary));</span><br><span>       }</span><br><span>    /* 9.4.24 Intave Parameter */</span><br><span>        if (TLVP_PRES_LEN(&tp, NM_ATT_INTAVE_PARAM, 1))</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/24706">change 24706</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/+/24706"/><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: I7f83d8e6eb6cc19e3e9529ba06617a902de23e35 </div>
<div style="display:none"> Gerrit-Change-Number: 24706 </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>