summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/src/gprs/gb_proxy_main.c12
-rw-r--r--openbsc/src/gprs/gtphub_main.c11
-rw-r--r--openbsc/src/gprs/sgsn_main.c11
-rw-r--r--openbsc/src/libbsc/bsc_init.c6
-rw-r--r--openbsc/src/osmo-bsc_mgcp/mgcp_main.c6
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c13
6 files changed, 43 insertions, 16 deletions
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c
index f82fb5b73..0c3cfbec4 100644
--- a/openbsc/src/gprs/gb_proxy_main.c
+++ b/openbsc/src/gprs/gb_proxy_main.c
@@ -252,10 +252,6 @@ int main(int argc, char **argv)
rate_ctr_init(tall_bsc_ctx);
osmo_stats_init(tall_bsc_ctx);
- rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_GBPROXY);
- if (rc < 0)
- exit(1);
-
bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb, tall_bsc_ctx);
if (!bssgp_nsi) {
LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
@@ -274,6 +270,14 @@ int main(int argc, char **argv)
exit(2);
}
+ /* start telnet after reading config for vty_get_bind_addr() */
+ LOGP(DGPRS, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), OSMO_VTY_PORT_GBPROXY);
+ rc = telnet_init_dynif(tall_bsc_ctx, &dummy_network,
+ vty_get_bind_addr(), OSMO_VTY_PORT_GBPROXY);
+ if (rc < 0)
+ exit(1);
+
if (!gprs_nsvc_by_nsei(gbcfg.nsi, gbcfg.nsip_sgsn_nsei)) {
LOGP(DGPRS, LOGL_FATAL, "You cannot proxy to NSEI %u "
"without creating that NSEI before\n",
diff --git a/openbsc/src/gprs/gtphub_main.c b/openbsc/src/gprs/gtphub_main.c
index f18710d3c..89582b1d5 100644
--- a/openbsc/src/gprs/gtphub_main.c
+++ b/openbsc/src/gprs/gtphub_main.c
@@ -314,9 +314,6 @@ int main(int argc, char **argv)
gtphub_vty_init(hub, cfg);
rate_ctr_init(osmo_gtphub_ctx);
- rc = telnet_init(osmo_gtphub_ctx, 0, OSMO_VTY_PORT_GTPHUB);
- if (rc < 0)
- exit(1);
handle_options(ccfg, argc, argv);
@@ -327,6 +324,14 @@ int main(int argc, char **argv)
exit(2);
}
+ /* start telnet after reading config for vty_get_bind_addr() */
+ LOGP(DGTPHUB, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), OSMO_VTY_PORT_GTPHUB);
+ rc = telnet_init_dynif(osmo_gtphub_ctx, 0, vty_get_bind_addr(),
+ OSMO_VTY_PORT_GTPHUB);
+ if (rc < 0)
+ exit(1);
+
if (gtphub_start(hub, cfg,
next_restart_count(ccfg->restart_counter_file))
!= 0)
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 2d3a0e4a9..b10b0b37f 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -315,9 +315,6 @@ int main(int argc, char **argv)
handle_options(argc, argv);
rate_ctr_init(tall_bsc_ctx);
- rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_SGSN);
- if (rc < 0)
- exit(1);
ctrl = sgsn_controlif_setup(NULL, OSMO_CTRL_PORT_SGSN);
if (!ctrl) {
@@ -357,6 +354,14 @@ int main(int argc, char **argv)
exit(2);
}
+ /* start telnet after reading config for vty_get_bind_addr() */
+ LOGP(DGPRS, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), OSMO_VTY_PORT_SGSN);
+ rc = telnet_init_dynif(tall_bsc_ctx, &dummy_network,
+ vty_get_bind_addr(), OSMO_VTY_PORT_SGSN);
+ if (rc < 0)
+ exit(1);
+
rc = sgsn_gtp_init(&sgsn_inst);
if (rc) {
LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n");
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 743f4c155..859d9998f 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -495,7 +495,11 @@ int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *),
return rc;
}
- rc = telnet_init(tall_bsc_ctx, bsc_gsmnet, OSMO_VTY_PORT_NITB_BSC);
+ /* start telnet after reading config for vty_get_bind_addr() */
+ LOGP(DNM, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), OSMO_VTY_PORT_NITB_BSC);
+ rc = telnet_init_dynif(tall_bsc_ctx, bsc_gsmnet, vty_get_bind_addr(),
+ OSMO_VTY_PORT_NITB_BSC);
if (rc < 0)
return rc;
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index d755c906c..e226b02ad 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -232,7 +232,11 @@ int main(int argc, char **argv)
if (rc < 0)
return rc;
- rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_BSC_MGCP);
+ /* start telnet after reading config for vty_get_bind_addr() */
+ LOGP(DMGCP, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), OSMO_VTY_PORT_BSC_MGCP);
+ rc = telnet_init_dynif(tall_bsc_ctx, &dummy_network,
+ vty_get_bind_addr(), OSMO_VTY_PORT_BSC_MGCP);
if (rc < 0)
return rc;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 2d4f2a801..04c12e33f 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1628,15 +1628,20 @@ int main(int argc, char **argv)
osmo_stats_init(tall_bsc_ctx);
/* init vty and parse */
- if (telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_BSC_NAT)) {
- fprintf(stderr, "Creating VTY telnet line failed\n");
- return -5;
- }
if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) {
fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file);
return -3;
}
+ /* start telnet after reading config for vty_get_bind_addr() */
+ LOGP(DNAT, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), OSMO_VTY_PORT_BSC_NAT);
+ if (telnet_init_dynif(tall_bsc_ctx, NULL, vty_get_bind_addr(),
+ OSMO_VTY_PORT_BSC_NAT)) {
+ fprintf(stderr, "Creating VTY telnet line failed\n");
+ return -5;
+ }
+
/* over rule the VTY config for MSC IP */
if (msc_ip)
bsc_nat_set_msc_ip(nat, msc_ip);