osmo-mgw: err-log: include expected domain name

Add the expected domain name, and move the error log to where the expected
domain name is compared.

Change-Id: I59f40dc9263f686852f103ca904fc0a6702d7c8e
This commit is contained in:
Neels Hofmeyr
2018-12-19 00:31:48 +01:00
parent ad21a0e166
commit 96c3107daf

View File

@@ -223,8 +223,10 @@ static int check_domain_name(struct mgcp_config *cfg, const char *mgcp)
if (!strcmp(cfg->domain, "*"))
return 0;
if (strcmp(domain_to_check+1, cfg->domain) != 0)
if (strcmp(domain_to_check+1, cfg->domain) != 0) {
LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s', expecting '%s'\n", mgcp, cfg->domain);
return -EINVAL;
}
return 0;
}
@@ -244,7 +246,6 @@ static struct mgcp_endpoint *find_endpoint(struct mgcp_config *cfg,
/* Check if the domainname in the request is correct */
if (check_domain_name(cfg, mgcp)) {
LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp);
*cause = -500;
return NULL;
}