<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/18503">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sccp_user_find: optimize: search PC only for valid PC arg<br><br>Though, since in current practice, not many users exist, and all incoming<br>messages have a valid PC, this is unlikely to have any noticeable effect.<br><br>Change-Id: I3533a01e29b97bebe4b8f1f6965444519b3bacfe<br>---<br>M src/sccp_user.c<br>1 file changed, 6 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/18503/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sccp_user.c b/src/sccp_user.c</span><br><span>index a36ac93..d8a7357 100644</span><br><span>--- a/src/sccp_user.c</span><br><span>+++ b/src/sccp_user.c</span><br><span>@@ -50,10 +50,12 @@</span><br><span> {</span><br><span>      struct osmo_sccp_user *scu;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* First try to find match for PC + SSN */</span><br><span style="color: hsl(0, 100%, 40%);">-      llist_for_each_entry(scu, &inst->users, list) {</span><br><span style="color: hsl(0, 100%, 40%);">-          if (osmo_ss7_pc_is_valid(scu->pc) && scu->pc == pc && scu->ssn == ssn)</span><br><span style="color: hsl(0, 100%, 40%);">-                 return scu;</span><br><span style="color: hsl(120, 100%, 40%);">+   if (osmo_ss7_pc_is_valid(pc)) {</span><br><span style="color: hsl(120, 100%, 40%);">+               /* First try to find match for PC + SSN */</span><br><span style="color: hsl(120, 100%, 40%);">+            llist_for_each_entry(scu, &inst->users, list) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (osmo_ss7_pc_is_valid(scu->pc) && scu->pc == pc && scu->ssn == ssn)</span><br><span style="color: hsl(120, 100%, 40%);">+                               return scu;</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span>    }</span><br><span> </span><br><span>        /* Then try to match on SSN only */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/18503">change 18503</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/libosmo-sccp/+/18503"/><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-Change-Id: I3533a01e29b97bebe4b8f1f6965444519b3bacfe </div>
<div style="display:none"> Gerrit-Change-Number: 18503 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>