mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
interpret domain '*' as 'allow any domain'
Make the 'domain NAME' vty doc more descriptive, and add the hint that '*' means any domain. In check_domain_name(), exit early in success if the configured domain name is '*'. (Do not implement other wildcard functionality for partial matches or the like, just the single '*'.) Related: OS#3490 Change-Id: Ie0220c88d2f5cee15f2a90390b3c4590ac61d5eb
This commit is contained in:
@@ -219,6 +219,10 @@ static int check_domain_name(struct mgcp_config *cfg, const char *mgcp)
|
||||
if (!domain_to_check)
|
||||
return -EINVAL;
|
||||
|
||||
/* Accept any domain if configured as "*" */
|
||||
if (!strcmp(cfg->domain, "*"))
|
||||
return 0;
|
||||
|
||||
if (strcmp(domain_to_check+1, cfg->domain) != 0)
|
||||
return -EINVAL;
|
||||
|
||||
|
@@ -1208,7 +1208,9 @@ DEFUN(cfg_mgcp_osmux_dummy,
|
||||
|
||||
DEFUN(cfg_mgcp_domain,
|
||||
cfg_mgcp_domain_cmd,
|
||||
"domain NAME", "domain\n" "qualified domain name\n")
|
||||
"domain NAME",
|
||||
"Set the domain part expected in MGCP messages' endpoint names\n"
|
||||
"Qualified domain name expected in MGCP endpoint names, or '*' to accept any domain\n")
|
||||
{
|
||||
osmo_strlcpy(g_cfg->domain, argv[0], sizeof(g_cfg->domain));
|
||||
return CMD_SUCCESS;
|
||||
|
Reference in New Issue
Block a user