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
diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 648d86b..f98b9ee 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -223,8 +223,10 @@
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 @@
/* 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;
}