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
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: