<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/23859">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gbproxy_main: Process options after all initialization is done<br><br>Previously gprs_ns2_vty_init() was called after handle_options(). This<br>caused config-ns* commands to be missing when calling<br>osmo-gbproxy --vty-ref-xml<br>which is used to generate the vty reference manual.<br><br>This commit moves argument handling until after all VTY commands have<br>been installed.<br><br>Change-Id: I0f779c16085a42b308925a676b144999106f2b63<br>---<br>M src/gb_proxy_main.c<br>1 file changed, 17 insertions(+), 17 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/59/23859/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb_proxy_main.c b/src/gb_proxy_main.c</span><br><span>index cf7421f..1a4e951 100644</span><br><span>--- a/src/gb_proxy_main.c</span><br><span>+++ b/src/gb_proxy_main.c</span><br><span>@@ -289,23 +289,6 @@</span><br><span>  osmo_cpu_sched_vty_init(tall_sgsn_ctx);</span><br><span>      gbproxy_vty_init();</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- handle_options(argc, argv);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     /* Backwards compatibility: for years, the default config file name was</span><br><span style="color: hsl(0, 100%, 40%);">-  * osmo_gbproxy.cfg. All other Osmocom programs use osmo-*.cfg with a</span><br><span style="color: hsl(0, 100%, 40%);">-    * dash. To be able to use the new config file name without breaking</span><br><span style="color: hsl(0, 100%, 40%);">-     * previous setups that might rely on the legacy default config file</span><br><span style="color: hsl(0, 100%, 40%);">-     * name, we need to look for the old config file if no -c option was</span><br><span style="color: hsl(0, 100%, 40%);">-     * passed AND no file exists with the new default file name. */</span><br><span style="color: hsl(0, 100%, 40%);">- if (!config_file) {</span><br><span style="color: hsl(0, 100%, 40%);">-             /* No -c option was passed */</span><br><span style="color: hsl(0, 100%, 40%);">-           if (file_exists(CONFIG_FILE_LEGACY)</span><br><span style="color: hsl(0, 100%, 40%);">-                 && !file_exists(CONFIG_FILE_DEFAULT))</span><br><span style="color: hsl(0, 100%, 40%);">-                       config_file = CONFIG_FILE_LEGACY;</span><br><span style="color: hsl(0, 100%, 40%);">-               else</span><br><span style="color: hsl(0, 100%, 40%);">-                    config_file = CONFIG_FILE_DEFAULT;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    rate_ctr_init(tall_sgsn_ctx);</span><br><span>        osmo_stats_init(tall_sgsn_ctx);</span><br><span> </span><br><span>@@ -323,6 +306,23 @@</span><br><span>   gprs_ns2_vty_init(gbcfg->nsi);</span><br><span>    logging_vty_add_deprecated_subsys(tall_sgsn_ctx, "bssgp");</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+      handle_options(argc, argv);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Backwards compatibility: for years, the default config file name was</span><br><span style="color: hsl(120, 100%, 40%);">+        * osmo_gbproxy.cfg. All other Osmocom programs use osmo-*.cfg with a</span><br><span style="color: hsl(120, 100%, 40%);">+  * dash. To be able to use the new config file name without breaking</span><br><span style="color: hsl(120, 100%, 40%);">+   * previous setups that might rely on the legacy default config file</span><br><span style="color: hsl(120, 100%, 40%);">+   * name, we need to look for the old config file if no -c option was</span><br><span style="color: hsl(120, 100%, 40%);">+   * passed AND no file exists with the new default file name. */</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!config_file) {</span><br><span style="color: hsl(120, 100%, 40%);">+           /* No -c option was passed */</span><br><span style="color: hsl(120, 100%, 40%);">+         if (file_exists(CONFIG_FILE_LEGACY)</span><br><span style="color: hsl(120, 100%, 40%);">+               && !file_exists(CONFIG_FILE_DEFAULT))</span><br><span style="color: hsl(120, 100%, 40%);">+                     config_file = CONFIG_FILE_LEGACY;</span><br><span style="color: hsl(120, 100%, 40%);">+             else</span><br><span style="color: hsl(120, 100%, 40%);">+                  config_file = CONFIG_FILE_DEFAULT;</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  bssgp_set_bssgp_callback(gbprox_bssgp_send_cb, gbcfg);</span><br><span> </span><br><span>   rc = gbproxy_parse_config(config_file, gbcfg);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/23859">change 23859</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-gbproxy/+/23859"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gbproxy </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0f779c16085a42b308925a676b144999106f2b63 </div>
<div style="display:none"> Gerrit-Change-Number: 23859 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>