Change in osmo-mgw[master]: create_response_with_sdp: Fix inclusion of X-Osmux

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Apr 25 21:38:31 UTC 2019


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13775 )

Change subject: create_response_with_sdp: Fix inclusion of X-Osmux
......................................................................

create_response_with_sdp: Fix inclusion of X-Osmux

In previous code, 2 blocks were handling osmux inclusion one after the
other under same osmux.state. However, first block changes osmux.state
so second block can never be true and X-Osmux is never added.

Change-Id: Iceee8b64978651f1fe6bb883923561b081f73d9b
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 2 insertions(+), 9 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 be161ad..bfb88bc 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -304,7 +304,6 @@
 	struct msgb *sdp;
 	int rc;
 	struct msgb *result;
-	char osmux_extension[strlen("X-Osmux: 255") + 1];
 	char local_ip_addr[INET_ADDRSTRLEN];
 
 	sdp = msgb_alloc_headroom(4096, 128, "sdp record");
@@ -316,13 +315,6 @@
 		addr = local_ip_addr;
 	}
 
-	if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) {
-		sprintf(osmux_extension, "X-Osmux: %u", conn->osmux.cid);
-		conn->osmux.state = OSMUX_STATE_ACTIVATING;
-	} else {
-		osmux_extension[0] = '\0';
-	}
-
 	/* Attach optional connection parameters */
 	if (add_conn_params) {
 		rc = add_params(sdp, endp, conn);
@@ -332,9 +324,10 @@
 
 	/* Attach optional OSMUX parameters */
 	if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) {
-		rc = msgb_printf(sdp, "%s\r\n", osmux_extension);
+		rc = msgb_printf(sdp, "X-Osmux: %u\r\n", conn->osmux.cid);
 		if (rc < 0)
 			goto error;
+		conn->osmux.state = OSMUX_STATE_ACTIVATING;
 	}
 
 	/* Attach line break to separate the parameters from the SDP block */

-- 
To view, visit https://gerrit.osmocom.org/13775
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: Iceee8b64978651f1fe6bb883923561b081f73d9b
Gerrit-Change-Number: 13775
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190425/cf17921b/attachment.html>


More information about the gerrit-log mailing list