Change in osmo-mgw[master]: mgcp: mgcp_osmux: use conn_bts when forwarding pkts from bsc_nat

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

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu May 17 12:33:04 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9215


Change subject: mgcp: mgcp_osmux: use conn_bts when forwarding pkts from bsc_nat
......................................................................

mgcp: mgcp_osmux: use conn_bts when forwarding pkts from bsc_nat

This commit actually doesn't fix the entire code, since anyway osmux
conns are not supported and mgcp_conn_get_rtp() will return NULL.
However, it makes the code more logical and easier to understand once
somebody refactors the code to make it work again.

Change-Id: Ib57e12e5a36b5842c40673c236907bbcbfc390f3
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 6 insertions(+), 6 deletions(-)



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

diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 1d3cab3..bdc285b 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -326,7 +326,7 @@
 	struct sockaddr_in addr;
 	struct mgcp_config *cfg = ofd->data;
 	uint32_t rem;
-	struct mgcp_conn_rtp *conn_net = NULL;
+	struct mgcp_conn_rtp *conn_bts = NULL;
 
 	msg = osmux_recv(ofd, &addr);
 	if (!msg)
@@ -345,8 +345,8 @@
 				       &addr.sin_addr, MGCP_DEST_NET);
 
 		/* FIXME: Get rid of CONN_ID_XXX! */
-		conn_net = mgcp_conn_get_rtp(endp, CONN_ID_NET);
-		if (!conn_net)
+		conn_bts = mgcp_conn_get_rtp(endp, CONN_ID_BTS);
+		if (!conn_bts)
 			goto out;
 
 		if (!endp) {
@@ -355,11 +355,11 @@
 			     osmuxh->circuit_id);
 			goto out;
 		}
-		conn_net->osmux.stats.octets += osmux_chunk_length(msg, rem);
-		conn_net->osmux.stats.chunks++;
+		conn_bts->osmux.stats.octets += osmux_chunk_length(msg, rem);
+		conn_bts->osmux.stats.chunks++;
 		rem = msg->len;
 
-		osmux_xfrm_output(osmuxh, &conn_net->osmux.out, &list);
+		osmux_xfrm_output(osmuxh, &conn_bts->osmux.out, &list);
 		osmux_tx_sched(&list, scheduled_tx_bts_cb, endp);
 	}
 out:

-- 
To view, visit https://gerrit.osmocom.org/9215
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: Ib57e12e5a36b5842c40673c236907bbcbfc390f3
Gerrit-Change-Number: 9215
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180517/2e5bf525/attachment.htm>


More information about the gerrit-log mailing list