[MERGED] osmo-mgw[master]: protocol: exit cleanly when local cx options check fails

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Feb 5 11:14:54 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: protocol: exit cleanly when local cx options check fails
......................................................................


protocol: exit cleanly when local cx options check fails

When set_local_cx_options() returns an error code the MGCP command
execution is aborted and and the error code is returned, but on
CRCX the already seized eindpoint is not released.

- Do not generate the error response on the spot, jump to the
  respective label and let the already existing error handling
  do its work.

This patch is a follow-up page to:
Change-Id I02aaa3042f2a0e32eb4ec6b8753deab7082947a0

Change-Id: Iaef4ea6c6a2f24ac8b276966bda72d0b30f25cd5
Related: OS#2654
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 2cbd87b..23c0c25 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -604,7 +604,8 @@
 		LOGP(DLMGCP, LOGL_ERROR,
 		     "CRCX: endpoint:%x inavlid local connection options!\n",
 		     ENDPOINT_NUMBER(endp));
-		return create_err_response(endp, rc, "CRCX", p->trans);
+		error_code = rc;
+		goto error2;
 	}
 
 	snprintf(conn_name, sizeof(conn_name), "%s", callid);
@@ -803,7 +804,8 @@
 		LOGP(DLMGCP, LOGL_ERROR,
 		     "MDCX: endpoint:%x inavlid local connection options!\n",
 		     ENDPOINT_NUMBER(endp));
-		return create_err_response(endp, rc, "MDCX", p->trans);
+		error_code = rc;
+		goto error3;
 	}
 
 	if (!have_sdp && endp->local_options.codec)

-- 
To view, visit https://gerrit.osmocom.org/6256
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaef4ea6c6a2f24ac8b276966bda72d0b30f25cd5
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list