Change in osmo-mgw[master]: osmux: Make func handling dummy frames independent of endp type

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Oct 16 20:45:15 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11379 )

Change subject: osmux: Make func handling dummy frames independent of endp type
......................................................................

osmux: Make func handling dummy frames independent of endp type

Port from openbsc 8f321179747f64819d940d72d0212192f69284ca.
Change-Id: I3e16217737fd5ffb95c166c5f7344492cb6a6263
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 9 insertions(+), 8 deletions(-)

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



diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 9081873..38cd3bd 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -387,30 +387,31 @@
 
 /* This is called from the bsc-nat */
 static int osmux_handle_dummy(struct mgcp_config *cfg, struct sockaddr_in *addr,
-			      struct msgb *msg)
+			      struct msgb *msg, int endp_type)
 {
 	struct mgcp_endpoint *endp;
 	uint8_t osmux_cid;
-	struct mgcp_conn_rtp *conn_net = NULL;
+	struct mgcp_conn_rtp *conn = NULL;
 
 	if (osmux_legacy_dummy_parse_cid(addr, msg, &osmux_cid) < 0)
 		goto out;
 
-	endp = endpoint_lookup(cfg, osmux_cid, &addr->sin_addr, MGCP_DEST_BTS);
+	endp = endpoint_lookup(cfg, osmux_cid, &addr->sin_addr, endp_type);
 	if (!endp) {
 		LOGP(DLMGCP, LOGL_ERROR,
 		     "Cannot find endpoint for Osmux CID %d\n", osmux_cid);
 		goto out;
 	}
 
-	conn_net = mgcp_conn_get_rtp(endp, CONN_ID_NET);
-	if (!conn_net)
+	/* FIXME: Get rid of CONN_ID_XXX! */
+	conn = mgcp_conn_get_rtp(endp, endp_type == MGCP_DEST_BTS ? CONN_ID_NET : CONN_ID_BTS);
+	if (!conn)
 		goto out;
 
-	if (conn_net->osmux.state == OSMUX_STATE_ENABLED)
+	if (conn->osmux.state == OSMUX_STATE_ENABLED)
 		goto out;
 
-	if (osmux_enable_conn(endp, conn_net, &addr->sin_addr, addr->sin_port) < 0 ) {
+	if (osmux_enable_conn(endp, conn, &addr->sin_addr, addr->sin_port) < 0 ) {
 		LOGP(DLMGCP, LOGL_ERROR,
 		     "Could not enable osmux in endpoint 0x%x\n",
 		     ENDPOINT_NUMBER(endp));
@@ -446,7 +447,7 @@
 
 	/* not any further processing dummy messages */
 	if (msg->data[0] == MGCP_DUMMY_LOAD)
-		return osmux_handle_dummy(cfg, &addr, msg);
+		return osmux_handle_dummy(cfg, &addr, msg, MGCP_DEST_BTS);
 
 	rem = msg->len;
 	while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL) {

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


More information about the gerrit-log mailing list