<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12863">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">OML: Return attributes in ACK/NACK messages<br><br>As per 3GPP TS 12.21 Section 8.2 "ACK messages shall return all the<br>attributes in the original message". OsmoBTS fails to do so but simply<br>sends no attributes at all in the ACK.<br><br>TS 12.21 is a bit vague whether or not the attributes shall also be<br>achoed in the NACK.  Let's do it and append the CAUSE in this case.<br><br>Closes: OS#3788<br>Change-Id: Ifb305fe75f8305bb04872f26492b8b1bb8c27f49<br>---<br>M src/common/oml.c<br>1 file changed, 5 insertions(+), 11 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/63/12863/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/oml.c b/src/common/oml.c</span><br><span>index ce59865..0424c58 100644</span><br><span>--- a/src/common/oml.c</span><br><span>+++ b/src/common/oml.c</span><br><span>@@ -425,26 +425,19 @@</span><br><span>  * contained in 'msg'. ACK is sent if cause == 0; NACK otherwise */</span><br><span> int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-       struct abis_om_hdr *old_oh = msgb_l2(old_msg);</span><br><span style="color: hsl(0, 100%, 40%);">-  struct abis_om_fom_hdr *old_foh = msgb_l3(old_msg);</span><br><span>  struct msgb *msg;</span><br><span>    struct abis_om_fom_hdr *foh;</span><br><span style="color: hsl(0, 100%, 40%);">-    int is_manuf = 0;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   msg = oml_msgb_alloc();</span><br><span style="color: hsl(120, 100%, 40%);">+       msg = msgb_copy(old_msg, "OML_fom_ack_nack");</span><br><span>      if (!msg)</span><br><span>            return -ENOMEM;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     /* make sure to respond with MANUF if request was MANUF */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (old_oh->mdisc == ABIS_OM_MDISC_MANUF)</span><br><span style="color: hsl(0, 100%, 40%);">-            is_manuf = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+ /* remove any l2/l1 that may be present in copy */</span><br><span style="color: hsl(120, 100%, 40%);">+    msgb_pull_to_l2(msg);</span><br><span> </span><br><span>    msg->trx = old_msg->trx;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      /* copy over old FOM-Header and later only change the msg_type */</span><br><span style="color: hsl(0, 100%, 40%);">-       msg->l3h = msgb_push(msg, sizeof(*foh));</span><br><span>  foh = (struct abis_om_fom_hdr *) msg->l3h;</span><br><span style="color: hsl(0, 100%, 40%);">-   memcpy(foh, old_foh, sizeof(*foh));</span><br><span> </span><br><span>      /* alter message type */</span><br><span>     if (cause) {</span><br><span>@@ -458,7 +451,8 @@</span><br><span>           foh->msg_type++; /* ack */</span><br><span>        }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   return oml_send_msg(msg, is_manuf);</span><br><span style="color: hsl(120, 100%, 40%);">+   /* we cannot use oml_send_msg() as we already have the OML header */</span><br><span style="color: hsl(120, 100%, 40%);">+  return abis_oml_sendmsg(msg);</span><br><span> }</span><br><span> </span><br><span> /*</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12863">change 12863</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/12863"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ifb305fe75f8305bb04872f26492b8b1bb8c27f49 </div>
<div style="display:none"> Gerrit-Change-Number: 12863 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>