From 4d8cccc6509cee79fdf12b48ebcf6238fd59c3b0 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 11 Aug 2017 11:30:26 +0200 Subject: sccp: again fix handling of default IP addresses in osmo_sccp_simple_client() The previous fix (I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34) caused the default addresses to be discarded. Actually talloc_strdup() the default addresses to use them if not NULL. Change-Id: Ic8563ab272d5256a1b8ceefd5fee37da61e1bd26 --- src/sccp_user.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sccp_user.c b/src/sccp_user.c index b0a807d..06a7174 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -426,10 +426,8 @@ osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, goto out_rt; asp_created = true; - asp->cfg.local.host = - default_local_ip ? asp->cfg.local.host : NULL; - asp->cfg.remote.host = - default_remote_ip ? asp->cfg.remote.host : NULL; + asp->cfg.local.host = default_local_ip ? talloc_strdup(asp, default_local_ip) : NULL; + asp->cfg.remote.host = default_remote_ip ? talloc_strdup(asp, default_remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- cgit v1.2.3