Change in libosmo-sccp[master]: ss7: Fix sccp_simple_server rejecting connections

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

pespin gerrit-no-reply at lists.osmocom.org
Mon Jan 13 12:41:36 UTC 2020


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

Change subject: ss7: Fix sccp_simple_server rejecting connections
......................................................................

ss7: Fix sccp_simple_server rejecting connections

Server addresses (and remote added ones) were not being copied to the
ASP and hence connections were not matches against the ASP when
connecting:

osmo_ss7.c:1820 (r=127.0.0.2:2905<->l=127.0.0.1:2905): m3ua connection
without matching ASP definition and no dynamic registration enabled, terminating

Related: OS#4355
Change-Id: I77d4f4d733cb46eaaacc7dc32259c9851c79d78e
---
M src/sccp_user.c
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/src/sccp_user.c b/src/sccp_user.c
index 39ebc71..9df5817 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -700,6 +700,7 @@
 	struct osmo_ss7_as *as;
 	struct osmo_ss7_route *rt;
 	struct osmo_ss7_asp *asp;
+	struct osmo_xua_server *oxs;
 	char *as_name, *asp_name;
 
 	if (local_port < 0)
@@ -724,6 +725,15 @@
 	asp = osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, local_port, prot);
 	if (!asp)
 		goto out_rt;
+	oxs = osmo_ss7_xua_server_find(ss7, prot, local_port);
+	if (!oxs)
+		goto out_asp;
+	if (osmo_ss7_asp_peer_set_hosts(&asp->cfg.local, asp,
+					(const char* const*)oxs->cfg.local.host,
+					oxs->cfg.local.host_cnt) < 0)
+		goto out_asp;
+	if (osmo_ss7_asp_peer_add_host(&asp->cfg.remote, asp, remote_ip) < 0)
+		goto out_asp;
 	asp->cfg.is_server = true;
 	asp->cfg.role = OSMO_SS7_ASP_ROLE_SG;
 	osmo_ss7_as_add_asp(as, asp_name);
@@ -733,6 +743,8 @@
 
 	return ss7->sccp;
 
+out_asp:
+	osmo_ss7_asp_destroy(asp);
 out_rt:
 	osmo_ss7_route_destroy(rt);
 out_as:

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I77d4f4d733cb46eaaacc7dc32259c9851c79d78e
Gerrit-Change-Number: 16797
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith 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/20200113/1cac0374/attachment.htm>


More information about the gerrit-log mailing list