osmo-hnbgw, hnb-test: allow configuring VTY address
diff --git a/src/hnbgw.c b/src/hnbgw.c
index 2353708..3553f9e 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -412,7 +412,11 @@
vty_init(&vty_info);
hnbgw_vty_init();
- rc = telnet_init(NULL, g_hnb_gw, 2323);
+ /* NOTE: if we add a config file, read the config before
+ * fetching the telnet address with vty_get_bind_addr() */
+ LOGP(DMAIN, LOGL_NOTICE, "VTY at %s %d\n",
+ vty_get_bind_addr(), 2323);
+ rc = telnet_init_dynif(NULL, g_hnb_gw, vty_get_bind_addr(), 2323);
if (rc < 0) {
perror("Error binding VTY port");
exit(1);
diff --git a/src/tests/hnb-test.c b/src/tests/hnb-test.c
index 569bcdd..6ec5abd 100644
--- a/src/tests/hnb-test.c
+++ b/src/tests/hnb-test.c
@@ -573,7 +573,8 @@
vty_init(&vty_info);
hnbtest_vty_init();
- rc = telnet_init(NULL, NULL, 2324);
+ printf("VTY at %s %d\n", vty_get_bind_addr(), 2324);
+ rc = telnet_init_dynif(NULL, NULL, vty_get_bind_addr(), 2324);
if (rc < 0) {
perror("Error binding VTY port");
exit(1);