diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-03-22 02:09:06 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-03-28 17:10:11 +0700 |
commit | 81635d3400f9837ecd6dcf3b512de50bf6aee9f2 (patch) | |
tree | 3a02859ed19e682078c6eed34e81bb1875549536 /src/libmsc/sgs_iface.c | |
parent | 1d802e2635f2f281815f767be62124d9499000f6 (diff) |
libmsc: fix: properly initialize the SGs server
It was observed that the SGs server is started before
the actual VTY configuration is parsed. For example:
sgs
local-port 9999
local-ip 127.0.0.1
vlr-name vlr.example.net
produces the following debug output:
<0011> sgs_server.c:185 SGs socket bound to r=NULL<->l=0.0.0.0:29118
DLSS7 NOTICE <001e> osmo_ss7.c:1284 0: ASP Restart for server not implemented yet!
DSGS NOTICE <0011> sgs_server.c:185 SGs socket bound to r=NULL<->l=0.0.0.0:9999
DSGS NOTICE <0011> sgs_server.c:185 SGs socket bound to r=NULL<->l=127.0.0.1:9999
DMNCC DEBUG <0004> msc_main.c:604 Using internal MNCC handler.
The first startup is triggered by sgs_iface_init(), before reading
the VTY configuration, so the logging style is different. The next
two calls to sgs_server_open() are triggered during reading of the
VTY configuration by cfg_sgs_local_port() and cfg_sgs_local_ip().
Let's avoid starting the SGs server three times, and do it once,
after the VTY configuration is parsed. Also, keep the possibility
to change the binding parameters at run-time.
Change-Id: Ie0c31205ac48be7e50d0380a89833771b2708da4
Diffstat (limited to 'src/libmsc/sgs_iface.c')
-rw-r--r-- | src/libmsc/sgs_iface.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c index 95b68f8a6..450d552fb 100644 --- a/src/libmsc/sgs_iface.c +++ b/src/libmsc/sgs_iface.c @@ -1258,8 +1258,6 @@ struct sgs_state *sgs_iface_init(void *ctx, struct gsm_network *network) return NULL; g_sgs = sgs; - sgs_server_open(sgs); - return sgs; } |