summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-11-08 15:51:14 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2019-11-08 15:51:18 +0100
commit7baf7d903aa3550c24fb464a1255116eaf68fe60 (patch)
tree3ae3aba77b89ca372e331f9d9d79c3e7762c4643
parent3dc31bda973bb62e8f1027ce8f7f947d89576565 (diff)
ss7: Set correct local addr and port during dynamic ASP creationpespin/master
-rw-r--r--src/osmo_ss7.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 4d5c349..0d49d1a 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1718,6 +1718,7 @@ static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd)
struct osmo_xua_server *oxs = osmo_stream_srv_link_get_data(link);
struct osmo_stream_srv *srv;
struct osmo_ss7_asp *asp;
+ int i;
char *sock_name = osmo_sock_get_name(link, fd);
const char *proto_name = get_value_string(osmo_ss7_asp_protocol_vals, oxs->cfg.proto);
@@ -1764,8 +1765,10 @@ static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd)
sock_name, asp->cfg.name);
asp->cfg.is_server = true;
asp->cfg.role = OSMO_SS7_ASP_ROLE_SG;
- asp->cfg.local.host[0] = NULL;
- asp->cfg.local.host_cnt = 1;
+ asp->cfg.local.port = oxs->cfg.local.port;
+ for (i = 0; i < oxs->cfg.local.host_cnt; i++)
+ asp->cfg.local.host[i] = talloc_strdup(asp, oxs->cfg.local.host[i]);
+ asp->cfg.local.host_cnt = oxs->cfg.local.host_cnt;
asp->cfg.remote.port = atoi(portbuf);
asp->cfg.remote.host[0] = talloc_strdup(asp, hostbuf);
asp->cfg.remote.host_cnt = 1;