Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11457 )

Change subject: mobile: fix vty bind ip override
......................................................................

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
---
M src/host/layer23/src/mobile/main.c
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, approved



diff --git a/src/host/layer23/src/mobile/main.c 
b/src/host/layer23/src/mobile/main.c
index 115ac41..297a534 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 @@
 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 @@
        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 @@
        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)

--
To view, visit https://gerrit.osmocom.org/11457
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa
Gerrit-Change-Number: 11457
Gerrit-PatchSet: 3
Gerrit-Owner: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msur...@sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to