summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-11-08 15:51:14 +0100
committerlaforge <laforge@osmocom.org>2019-11-12 14:18:39 +0000
commit30275e13ef6060bc81e5969e7c202f6464b558fa (patch)
tree4111d18b582da43b859ea96cbd6c6393abe308e8
parent6090d7e6b7245199440cce2b336b0e7a9aee20c2 (diff)
ss7: Set correct local addr and port during dynamic ASP creation
-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;