Change in libosmo-sccp[master]: ss7: Fix finding asp by socket addr if it has no remote hosts configured

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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Oct 23 18:10:11 UTC 2019


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

Change subject: ss7: Fix finding asp by socket addr if it has no remote hosts configured
......................................................................

ss7: Fix finding asp by socket addr if it has no remote hosts configured

Fixes: 80b135581909fef595d48436ab04dbcb147e3895
Change-Id: I14a0132a4667cea75fc212dfeeef76d8509b991d
---
M src/osmo_ss7.c
1 file changed, 8 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 8a86af1..88c4922 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1174,12 +1174,15 @@
 			if (i == asp->cfg.local.host_cnt)
 				continue; /* didn't match any local.host */
 
-			for (i = 0; i < asp->cfg.remote.host_cnt; i++) {
-				if (!asp->cfg.remote.host[i] || !strcmp(asp->cfg.remote.host[i], hostbuf_r))
-					break;
+			/* If no remote host was set, it's probably a server and hence we match any cli src */
+			if (asp->cfg.remote.host_cnt) {
+				for (i = 0; i < asp->cfg.remote.host_cnt; i++) {
+					if (!asp->cfg.remote.host[i] || !strcmp(asp->cfg.remote.host[i], hostbuf_r))
+						break;
+				}
+				if (i == asp->cfg.remote.host_cnt)
+					continue; /* didn't match any remote.host */
 			}
-			if (i == asp->cfg.remote.host_cnt)
-				continue; /* didn't match any remote.host */
 
 			return asp;
 		}

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I14a0132a4667cea75fc212dfeeef76d8509b991d
Gerrit-Change-Number: 15867
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191023/3755fb2e/attachment.htm>


More information about the gerrit-log mailing list