Change in osmo-pcap[master]: vty: call telnet_init_dynif() after config file is read

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Apr 24 14:14:46 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/23880 )

Change subject: vty: call telnet_init_dynif() after config file is read
......................................................................

vty: call telnet_init_dynif() after config file is read

In case the config file specifies a vty bind address, we must read
it before we start the telnet server.

Change-Id: I44561754d4beaad5c74cb66994ca4ef38960ea78
---
M src/osmo_client_main.c
M src/osmo_server_main.c
2 files changed, 13 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c
index 0951115..1ab24c3 100644
--- a/src/osmo_client_main.c
+++ b/src/osmo_client_main.c
@@ -259,12 +259,6 @@
 
 	osmo_tls_init();
 
-	rc = telnet_init_dynif(tall_cli_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_PCAP_CLIENT);
-	if (rc < 0) {
-		LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n");
-		exit(1);
-	}
-
 	pcap_client = osmo_pcap_client_alloc(tall_cli_ctx);
 	if (!pcap_client) {
 		LOGP(DCLIENT, LOGL_ERROR, "Failed to allocate osmo_pcap_client.\n");
@@ -289,6 +283,13 @@
 		exit(1);
 	}
 
+	rc = telnet_init_dynif(tall_cli_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_PCAP_CLIENT);
+	if (rc < 0) {
+		LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n");
+		exit(1);
+	}
+
+
 	/* attempt to connect to the remote */
 	if (pcap_client->conn.srv_ip && pcap_client->conn.srv_port > 0)
 		osmo_client_connect(&pcap_client->conn);
diff --git a/src/osmo_server_main.c b/src/osmo_server_main.c
index b5f573c..f198b58 100644
--- a/src/osmo_server_main.c
+++ b/src/osmo_server_main.c
@@ -271,12 +271,6 @@
 
 	osmo_tls_init();
 
-	rc = telnet_init_dynif(tall_srv_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_PCAP_SERVER);
-	if (rc < 0) {
-		LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n");
-		exit(1);
-	}
-
 	pcap_server = talloc_zero(tall_srv_ctx, struct osmo_pcap_server);
 	if (!pcap_server) {
 		LOGP(DSERVER, LOGL_ERROR, "Failed to allocate osmo_pcap_server.\n");
@@ -299,6 +293,12 @@
 		exit(1);
 	}
 
+	rc = telnet_init_dynif(tall_srv_ctx, NULL, vty_get_bind_addr(), OSMO_VTY_PORT_PCAP_SERVER);
+	if (rc < 0) {
+		LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n");
+		exit(1);
+	}
+
 	osmo_tls_server_init(pcap_server);
 
 	/* attempt to connect to the remote */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/23880
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I44561754d4beaad5c74cb66994ca4ef38960ea78
Gerrit-Change-Number: 23880
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210424/54cf1550/attachment.htm>


More information about the gerrit-log mailing list