Change in osmo-mgw[master]: mgcp_client_fsm: improve error logging

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Jun 15 15:30:11 UTC 2018


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9645


Change subject: mgcp_client_fsm: improve error logging
......................................................................

mgcp_client_fsm: improve error logging

Change-Id: I2feefaeefc2d71b64714585ef8137afbb4055b7e
---
M src/libosmo-mgcp-client/mgcp_client_fsm.c
1 file changed, 10 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/45/9645/1

diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c
index 10a5b6d..25543ae 100644
--- a/src/libosmo-mgcp-client/mgcp_client_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c
@@ -630,17 +630,24 @@
 	OSMO_ASSERT(fi->state != ST_DLCX_RESP);
 
 	/* Check if IP/Port parameters make sense */
-	if (conn_peer->port == 0)
+	if (conn_peer->port == 0) {
+		LOGPFSML(fi, LOGL_ERROR, "Cannot MDCX, port == 0\n");
 		return -EINVAL;
-	if (inet_aton(conn_peer->addr, &ip_test) == 0)
+	}
+	if (inet_aton(conn_peer->addr, &ip_test) == 0) {
+		LOGPFSML(fi, LOGL_ERROR, "Cannot MDCX, IP address == 0.0.0.0\n");
 		return -EINVAL;
+	}
 
 	/*! The user may supply an endpoint identifier in conn_peer. The
 	 *  identifier is then checked. This check is optional. Later steps do
 	 *  not depend on the endpoint identifier supplied here because it is
 	 *  already implicitly known from the CRCX phase. */
-	if (strlen(conn_peer->endpoint) && strcmp(conn_peer->endpoint, mgcp_ctx->conn_peer_remote.endpoint))
+	if (strlen(conn_peer->endpoint) && strcmp(conn_peer->endpoint, mgcp_ctx->conn_peer_remote.endpoint)) {
+		LOGPFSML(fi, LOGL_ERROR, "Cannot MDCX, endpoint mismatches: requested %s, should be %s\n",
+			 conn_peer->endpoint, mgcp_ctx->conn_peer_remote.endpoint);
 		return -EINVAL;
+	}
 
 	/*! Note: The call-id is implicitly known from the previous CRCX and
 	 *  will not be checked even when it is set in conn_peer. */

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2feefaeefc2d71b64714585ef8137afbb4055b7e
Gerrit-Change-Number: 9645
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180615/491e43cf/attachment.htm>


More information about the gerrit-log mailing list