Change in libosmo-sccp[master]: sccp_user_find: optimize: search PC only for valid PC arg

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Mon Jun 15 13:20:48 UTC 2020


neels has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/18503 )

Change subject: sccp_user_find: optimize: search PC only for valid PC arg
......................................................................

sccp_user_find: optimize: search PC only for valid PC arg

Though, since in current practice, not many users exist, and all incoming
messages have a valid PC, this is unlikely to have any noticeable effect.

Change-Id: I3533a01e29b97bebe4b8f1f6965444519b3bacfe
---
M src/sccp_user.c
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/sccp_user.c b/src/sccp_user.c
index a36ac93..d8a7357 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -50,10 +50,12 @@
 {
 	struct osmo_sccp_user *scu;
 
-	/* First try to find match for PC + SSN */
-	llist_for_each_entry(scu, &inst->users, list) {
-		if (osmo_ss7_pc_is_valid(scu->pc) && scu->pc == pc && scu->ssn == ssn)
-			return scu;
+	if (osmo_ss7_pc_is_valid(pc)) {
+		/* First try to find match for PC + SSN */
+		llist_for_each_entry(scu, &inst->users, list) {
+			if (osmo_ss7_pc_is_valid(scu->pc) && scu->pc == pc && scu->ssn == ssn)
+				return scu;
+		}
 	}
 
 	/* Then try to match on SSN only */

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/18503
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I3533a01e29b97bebe4b8f1f6965444519b3bacfe
Gerrit-Change-Number: 18503
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200615/13d0d039/attachment.htm>


More information about the gerrit-log mailing list