Change in osmo-mgw[master]: mgcp_client_vty: remove unnecessary checks

dexter gerrit-no-reply at lists.osmocom.org
Fri Jul 23 10:45:25 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/25029 )


Change subject: mgcp_client_vty: remove unnecessary checks
......................................................................

mgcp_client_vty: remove unnecessary checks

The vty always checks if global_mgcp_client_conf exists. (there is also
an assert This check about global_mgcp_client_ctx).
global_mgcp_client_ctx and global_mgcp_client_conf are populated before
the VTY commands are installed. Unleass the caller uses the API wrong
and calls mgcp_client_vty_init with NULL pointers there cannot be a
problem with unpopulated pointers. Lets remove the checks as they are
not needed.

Change-Id: I892d14c588573f76640453cb9c194594289b59f1
Related: SYS#5091
---
M src/libosmo-mgcp-client/mgcp_client_vty.c
1 file changed, 0 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/29/25029/1

diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 642d8d5..da0c4bf 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -41,9 +41,6 @@
       "local bind IPv4 address\n"
       "local bind IPv6 address\n")
 {
-	if (!global_mgcp_client_conf)
-		return CMD_ERR_NOTHING_TODO;
-	OSMO_ASSERT(global_mgcp_client_ctx);
 	osmo_talloc_replace_string(global_mgcp_client_ctx,
 				   (char**)&global_mgcp_client_conf->local_addr,
 				   argv[0]);
@@ -59,8 +56,6 @@
       MGW_STR "local port to connect to MGW from\n"
       "local bind port\n")
 {
-	if (!global_mgcp_client_conf)
-		return CMD_ERR_NOTHING_TODO;
 	global_mgcp_client_conf->local_port = atoi(argv[0]);
 	return CMD_SUCCESS;
 }
@@ -75,9 +70,6 @@
       "remote IPv4 address\n"
       "remote IPv6 address\n")
 {
-	if (!global_mgcp_client_conf)
-		return CMD_ERR_NOTHING_TODO;
-	OSMO_ASSERT(global_mgcp_client_ctx);
 	osmo_talloc_replace_string(global_mgcp_client_ctx,
 				   (char**)&global_mgcp_client_conf->remote_addr,
 				   argv[0]);
@@ -93,8 +85,6 @@
       MGW_STR "remote port to reach the MGW at\n"
       "remote port\n")
 {
-	if (!global_mgcp_client_conf)
-		return CMD_ERR_NOTHING_TODO;
 	global_mgcp_client_conf->remote_port = atoi(argv[0]);
 	return CMD_SUCCESS;
 }

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I892d14c588573f76640453cb9c194594289b59f1
Gerrit-Change-Number: 25029
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210723/1c868f93/attachment.htm>


More information about the gerrit-log mailing list