Change in osmo-gbproxy[master]: gbproxy_main: Process options after all initialization is done

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/.

daniel gerrit-no-reply at lists.osmocom.org
Thu Apr 22 14:18:25 UTC 2021


daniel has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/23859 )

Change subject: gbproxy_main: Process options after all initialization is done
......................................................................

gbproxy_main: Process options after all initialization is done

Previously gprs_ns2_vty_init() was called after handle_options(). This
caused config-ns* commands to be missing when calling
osmo-gbproxy --vty-ref-xml
which is used to generate the vty reference manual.

This commit moves argument handling until after all VTY commands have
been installed.

Change-Id: I0f779c16085a42b308925a676b144999106f2b63
---
M src/gb_proxy_main.c
1 file changed, 17 insertions(+), 17 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/gb_proxy_main.c b/src/gb_proxy_main.c
index cf7421f..1a4e951 100644
--- a/src/gb_proxy_main.c
+++ b/src/gb_proxy_main.c
@@ -289,23 +289,6 @@
 	osmo_cpu_sched_vty_init(tall_sgsn_ctx);
 	gbproxy_vty_init();
 
-	handle_options(argc, argv);
-
-	/* Backwards compatibility: for years, the default config file name was
-	 * osmo_gbproxy.cfg. All other Osmocom programs use osmo-*.cfg with a
-	 * dash. To be able to use the new config file name without breaking
-	 * previous setups that might rely on the legacy default config file
-	 * name, we need to look for the old config file if no -c option was
-	 * passed AND no file exists with the new default file name. */
-	if (!config_file) {
-		/* No -c option was passed */
-		if (file_exists(CONFIG_FILE_LEGACY)
-		    && !file_exists(CONFIG_FILE_DEFAULT))
-			config_file = CONFIG_FILE_LEGACY;
-		else
-			config_file = CONFIG_FILE_DEFAULT;
-	}
-
 	rate_ctr_init(tall_sgsn_ctx);
 	osmo_stats_init(tall_sgsn_ctx);
 
@@ -323,6 +306,23 @@
 	gprs_ns2_vty_init(gbcfg->nsi);
 	logging_vty_add_deprecated_subsys(tall_sgsn_ctx, "bssgp");
 
+	handle_options(argc, argv);
+
+	/* Backwards compatibility: for years, the default config file name was
+	 * osmo_gbproxy.cfg. All other Osmocom programs use osmo-*.cfg with a
+	 * dash. To be able to use the new config file name without breaking
+	 * previous setups that might rely on the legacy default config file
+	 * name, we need to look for the old config file if no -c option was
+	 * passed AND no file exists with the new default file name. */
+	if (!config_file) {
+		/* No -c option was passed */
+		if (file_exists(CONFIG_FILE_LEGACY)
+		    && !file_exists(CONFIG_FILE_DEFAULT))
+			config_file = CONFIG_FILE_LEGACY;
+		else
+			config_file = CONFIG_FILE_DEFAULT;
+	}
+
 	bssgp_set_bssgp_callback(gbprox_bssgp_send_cb, gbcfg);
 
 	rc = gbproxy_parse_config(config_file, gbcfg);

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

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I0f779c16085a42b308925a676b144999106f2b63
Gerrit-Change-Number: 23859
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210422/f51d5d35/attachment.htm>


More information about the gerrit-log mailing list