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#5091changes/29/25029/11
parent
3f2c15f275
commit
c534ad17dc
|
@ -42,9 +42,6 @@ DEFUN(cfg_mgw_local_ip, cfg_mgw_local_ip_cmd,
|
|||
"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]);
|
||||
|
@ -60,8 +57,6 @@ DEFUN(cfg_mgw_local_port, cfg_mgw_local_port_cmd,
|
|||
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;
|
||||
}
|
||||
|
@ -76,9 +71,6 @@ DEFUN(cfg_mgw_remote_ip, cfg_mgw_remote_ip_cmd,
|
|||
"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]);
|
||||
|
@ -94,8 +86,6 @@ DEFUN(cfg_mgw_remote_port, cfg_mgw_remote_port_cmd,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue