summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-10 14:59:53 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-01-13 12:43:59 +0100
commitbc84ef264e508ee55146d385a4cd81f829478094 (patch)
tree2f8e2efdeba7ccd2bf1245466d3c86762b51042e
parent191a305cb58087844103dd961756666e911218b4 (diff)
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
-rw-r--r--src/sccp_user.c12
1 files changed, 12 insertions, 0 deletions
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 @@ osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst,
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 @@ osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst,
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 @@ osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst,
return ss7->sccp;
+out_asp:
+ osmo_ss7_asp_destroy(asp);
out_rt:
osmo_ss7_route_destroy(rt);
out_as: