From fb153cbf8cb5e81e851f8dca5a0e466ab6c76cde Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 5 Dec 2018 00:47:31 +0100 Subject: msc_main: mncc: move mncc socket decision to after read_cfg First step towards allowing to configure the MNCC socket path by config file. Rationale: see I2ec59d5eba407f83295528b51b93678d446b9cee Change-Id: Ifc87c1cacaa809d04fc23e8ccd761bee4509c805 --- src/osmo-msc/msc_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/osmo-msc/msc_main.c') diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 07e4c8b8a..157d5ae56 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -545,11 +545,9 @@ int main(int argc, char **argv) /* Parse options */ handle_options(argc, argv); - /* Allocate global gsm_network struct; choose socket/internal MNCC */ - msc_network = msc_network_alloc(tall_msc_ctx, - msc_cmdline_config.mncc_sock_path? - mncc_sock_from_cc - : int_mncc_recv); + /* Allocate global gsm_network struct. + * At first set the internal MNCC as default, may be changed below according to cfg or cmdline option. */ + msc_network = msc_network_alloc(tall_msc_ctx, int_mncc_recv); if (!msc_network) return -ENOMEM; @@ -577,6 +575,7 @@ int main(int argc, char **argv) /* Initialize MNCC socket if appropriate */ if (msc_cmdline_config.mncc_sock_path) { + msc_network->mncc_recv = mncc_sock_from_cc; rc = mncc_sock_init(msc_network, msc_cmdline_config.mncc_sock_path); if (rc) { -- cgit v1.2.3