summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-11-19 17:16:28 +0100
committerMax <msuraev@sysmocom.de>2018-11-19 17:20:11 +0100
commitc8de8cb1e126a18c0269571fba38310589dd9273 (patch)
tree1dd3e5fd06cc70da5e6df33962ad3a21b160b70c
parentdcc7e6074a7b8a9f31056815deed3e6943db521f (diff)
mobile: fix vty bind ip override
Previously the vty bind config parameter was always ignored. Fix this by using proper default value from the config unless it's explicitly set via command-line parameter. Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa
-rw-r--r--src/host/layer23/src/mobile/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c
index 115ac419..297a5349 100644
--- a/src/host/layer23/src/mobile/main.c
+++ b/src/host/layer23/src/mobile/main.c
@@ -31,6 +31,7 @@
#include <osmocom/core/gsmtap.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/application.h>
+#include <osmocom/vty/vty.h>
#include <arpa/inet.h>
@@ -51,7 +52,7 @@ struct llist_head ms_list;
static char *gsmtap_ip = 0;
static const char *custom_cfg_file = NULL;
struct gsmtap_inst *gsmtap_inst = NULL;
-static char *vty_ip = "127.0.0.1";
+static char *vty_ip = NULL;
unsigned short vty_port = 4247;
char *config_dir = NULL;
int use_mncc_sock = 0;
@@ -90,7 +91,7 @@ static void print_help()
printf(" -u --vty-ip The VTY IP to telnet to. "
"(default %s)\n", vty_ip);
printf(" -v --vty-port The VTY port number to telnet to. "
- "(default %u)\n", vty_port);
+ "(default %s)\n", vty_get_bind_addr());
printf(" -d --debug Change debug flags. default: %s\n",
debug_default);
printf(" -D --daemonize Run as daemon\n");
@@ -248,7 +249,7 @@ int main(int argc, char **argv)
config_dir = dirname(config_dir);
if (use_mncc_sock)
- rc = l23_app_init(mncc_recv_socket, config_file, vty_ip, vty_port);
+ rc = l23_app_init(mncc_recv_socket, config_file, vty_ip ? vty_ip : vty_get_bind_addr(), vty_port);
else
rc = l23_app_init(NULL, config_file, vty_ip, vty_port);
if (rc)