<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/25029">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mgcp_client_vty: remove unnecessary checks<br><br>The vty always checks if global_mgcp_client_conf exists. (there is also<br>an assert This check about global_mgcp_client_ctx).<br>global_mgcp_client_ctx and global_mgcp_client_conf are populated before<br>the VTY commands are installed. Unleass the caller uses the API wrong<br>and calls mgcp_client_vty_init with NULL pointers there cannot be a<br>problem with unpopulated pointers. Lets remove the checks as they are<br>not needed.<br><br>Change-Id: I892d14c588573f76640453cb9c194594289b59f1<br>Related: SYS#5091<br>---<br>M src/libosmo-mgcp-client/mgcp_client_vty.c<br>1 file changed, 0 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/29/25029/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c</span><br><span>index 642d8d5..da0c4bf 100644</span><br><span>--- a/src/libosmo-mgcp-client/mgcp_client_vty.c</span><br><span>+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c</span><br><span>@@ -41,9 +41,6 @@</span><br><span>       "local bind IPv4 address\n"</span><br><span>       "local bind IPv6 address\n")</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   if (!global_mgcp_client_conf)</span><br><span style="color: hsl(0, 100%, 40%);">-           return CMD_ERR_NOTHING_TODO;</span><br><span style="color: hsl(0, 100%, 40%);">-    OSMO_ASSERT(global_mgcp_client_ctx);</span><br><span>         osmo_talloc_replace_string(global_mgcp_client_ctx,</span><br><span>                              (char**)&global_mgcp_client_conf->local_addr,</span><br><span>                                 argv[0]);</span><br><span>@@ -59,8 +56,6 @@</span><br><span>       MGW_STR "local port to connect to MGW from\n"</span><br><span>       "local bind port\n")</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!global_mgcp_client_conf)</span><br><span style="color: hsl(0, 100%, 40%);">-           return CMD_ERR_NOTHING_TODO;</span><br><span>         global_mgcp_client_conf->local_port = atoi(argv[0]);</span><br><span>      return CMD_SUCCESS;</span><br><span> }</span><br><span>@@ -75,9 +70,6 @@</span><br><span>       "remote IPv4 address\n"</span><br><span>       "remote IPv6 address\n")</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!global_mgcp_client_conf)</span><br><span style="color: hsl(0, 100%, 40%);">-           return CMD_ERR_NOTHING_TODO;</span><br><span style="color: hsl(0, 100%, 40%);">-    OSMO_ASSERT(global_mgcp_client_ctx);</span><br><span>         osmo_talloc_replace_string(global_mgcp_client_ctx,</span><br><span>                              (char**)&global_mgcp_client_conf->remote_addr,</span><br><span>                                argv[0]);</span><br><span>@@ -93,8 +85,6 @@</span><br><span>       MGW_STR "remote port to reach the MGW at\n"</span><br><span>       "remote port\n")</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!global_mgcp_client_conf)</span><br><span style="color: hsl(0, 100%, 40%);">-           return CMD_ERR_NOTHING_TODO;</span><br><span>         global_mgcp_client_conf->remote_port = atoi(argv[0]);</span><br><span>     return CMD_SUCCESS;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-mgw/+/25029">change 25029</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-mgw/+/25029"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I892d14c588573f76640453cb9c194594289b59f1 </div>
<div style="display:none"> Gerrit-Change-Number: 25029 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>