<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/13507">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sccp_scoc: move sccp_find_user() up<br><br>Move it before sccp_scoc_rx_scrc_rout_fail(), so it can be used in<br>the latter function to figure out the local_ref from the user (follow<br>up commit).<br><br>Related: OS#3871<br>Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855<br>---<br>M src/sccp_scoc.c<br>1 file changed, 25 insertions(+), 25 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c</span><br><span>index 726426c..82590a0 100644</span><br><span>--- a/src/sccp_scoc.c</span><br><span>+++ b/src/sccp_scoc.c</span><br><span>@@ -1329,6 +1329,31 @@</span><br><span>        return xua;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */</span><br><span style="color: hsl(120, 100%, 40%);">+static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst,</span><br><span style="color: hsl(120, 100%, 40%);">+                                      struct xua_msg *xua)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+       struct osmo_sccp_addr called_addr;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR);</span><br><span style="color: hsl(120, 100%, 40%);">+        if (rc < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+              LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA "</span><br><span style="color: hsl(120, 100%, 40%);">+                   "Message %s without valid DEST_ADDR\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                     xua_hdr_dump(xua, &xua_dialect_sua));</span><br><span style="color: hsl(120, 100%, 40%);">+             return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) {</span><br><span style="color: hsl(120, 100%, 40%);">+             LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for "</span><br><span style="color: hsl(120, 100%, 40%);">+                    "XUA Message %s without SSN in CalledAddr\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                       xua_hdr_dump(xua, &xua_dialect_sua));</span><br><span style="color: hsl(120, 100%, 40%);">+             return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return sccp_user_find(inst, called_addr.ssn, called_addr.pc);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! \brief SCOC: Receive SCRC Routing Failure</span><br><span>  *  \param[in] inst SCCP Instance on which we operate</span><br><span>  *  \param[in] xua SUA message that was failed to route</span><br><span>@@ -1355,31 +1380,6 @@</span><br><span>     }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */</span><br><span style="color: hsl(0, 100%, 40%);">-static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst,</span><br><span style="color: hsl(0, 100%, 40%);">-                                      struct xua_msg *xua)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-      int rc;</span><br><span style="color: hsl(0, 100%, 40%);">- struct osmo_sccp_addr called_addr;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (rc < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA "</span><br><span style="color: hsl(0, 100%, 40%);">-                     "Message %s without valid DEST_ADDR\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                       xua_hdr_dump(xua, &xua_dialect_sua));</span><br><span style="color: hsl(0, 100%, 40%);">-               return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) {</span><br><span style="color: hsl(0, 100%, 40%);">-               LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for "</span><br><span style="color: hsl(0, 100%, 40%);">-                      "XUA Message %s without SSN in CalledAddr\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                 xua_hdr_dump(xua, &xua_dialect_sua));</span><br><span style="color: hsl(0, 100%, 40%);">-               return NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       return sccp_user_find(inst, called_addr.ssn, called_addr.pc);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> /* Generate a COERR based in input arguments */</span><br><span> static struct xua_msg *gen_coerr(uint32_t route_ctx, uint32_t dest_ref,</span><br><span>                                 uint32_t err_cause)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/13507">change 13507</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/13507"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855 </div>
<div style="display:none"> Gerrit-Change-Number: 13507 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>