Neels Hofmeyr has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10557 )

Change subject: interpret domain '*' as 'allow any domain'
......................................................................

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
---
M src/libosmo-mgcp/mgcp_msg.c
M src/libosmo-mgcp/mgcp_vty.c
2 files changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Stefan Sperling: Looks good to me, but someone else must approve
  Neels Hofmeyr: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 7378ddc..a89c579 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -219,6 +219,10 @@
        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;

diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index ad462b7..00af3bd 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -1208,7 +1208,9 @@

 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;

--
To view, visit https://gerrit.osmocom.org/10557
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0220c88d2f5cee15f2a90390b3c4590ac61d5eb
Gerrit-Change-Number: 10557
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Stefan Sperling <ssperl...@sysmocom.de>

Reply via email to