pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29565 )
Change subject: osmux: Match remote address in osmux_conn_lookup()
......................................................................
osmux: Match remote address in osmux_conn_lookup()
Depends: libosmo-netif.git I95433b18802f73fa70e758f4aa02128eee940d88
Change-Id: Ia717efa5f68e9412b86ef44a4c42a0715ff0e469
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 14 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index abd4f32..9187007 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -251,7 +251,8 @@
{
struct mgcp_endpoint *endp;
struct mgcp_conn *conn = NULL;
- struct mgcp_conn_rtp * conn_rtp;
+ struct mgcp_conn_rtp *conn_rtp;
+ struct osmux_handle *h;
int i;
for (i = 0; i < trunk->number_endpoints; i++) {
@@ -266,7 +267,18 @@
if (!mgcp_conn_rtp_is_osmux(conn_rtp))
continue;
- /* FIXME: Match remote address! */
+ /* Current implementation sets remote address & port for
+ * the conn based on src address received on the socket
+ * for the CID, in order to workaround NATs.
+ * Once the conn is fully established (remote address is
+ * known), validate the remote address doesn't change: */
+ if (conn_rtp->osmux.state == OSMUX_STATE_ENABLED) {
+ h = osmux_xfrm_input_get_deliver_cb_data(conn_rtp->osmux.in);
+ if (osmo_sockaddr_cmp(&h->rem_addr, rem_addr) != 0)
+ continue;
+ }
+ /* else: select based on CID only, to learn rem addr in NAT-based scenarios.
+ * FIXME: This should be configurable, have some sort of "osmux nat (on|off)" */
if (conn_rtp->osmux.local_cid == local_cid)
return conn_rtp;
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29565
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia717efa5f68e9412b86ef44a4c42a0715ff0e469
Gerrit-Change-Number: 29565
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29568 )
Change subject: osmux: Unify rtp_conn osmux type into a single type
......................................................................
osmux: Unify rtp_conn osmux type into a single type
There's no need to separate between BSS and CN side nowadays, the
different types are used nowehere. This separation dates from
osmo-bsc-nat code days.
Change-Id: I65effeddf033eb1955553e8d659c593b4e67f7bc
---
M include/osmocom/mgcp/mgcp_conn.h
M src/libosmo-mgcp/mgcp_iuup.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_protocol.c
5 files changed, 7 insertions(+), 11 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/mgcp/mgcp_conn.h b/include/osmocom/mgcp/mgcp_conn.h
index d9b38c0..7ac40ab 100644
--- a/include/osmocom/mgcp/mgcp_conn.h
+++ b/include/osmocom/mgcp/mgcp_conn.h
@@ -46,8 +46,7 @@
/* Specific rtp connection type (see struct mgcp_conn_rtp) */
enum mgcp_conn_rtp_type {
MGCP_RTP_DEFAULT = 0,
- MGCP_OSMUX_BSC,
- MGCP_OSMUX_BSC_NAT,
+ MGCP_RTP_OSMUX,
MGCP_RTP_IUUP,
};
@@ -224,7 +223,7 @@
/* Was conn configured to handle Osmux? */
static inline bool mgcp_conn_rtp_is_osmux(const struct mgcp_conn_rtp *conn) {
- return conn->type == MGCP_OSMUX_BSC || conn->type == MGCP_OSMUX_BSC_NAT;
+ return conn->type == MGCP_RTP_OSMUX;
}
/* Was conn configured to handle Osmux? */
diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c
index 142b002..48e4ce7 100644
--- a/src/libosmo-mgcp/mgcp_iuup.c
+++ b/src/libosmo-mgcp/mgcp_iuup.c
@@ -342,8 +342,7 @@
return bridge_iuup_to_iuup_peer(conn_rtp_src, conn_rtp_dst, irp);
case MGCP_RTP_DEFAULT:
return bridge_iuup_to_rtp_peer(conn_rtp_src, conn_rtp_dst, irp);
- case MGCP_OSMUX_BSC:
- case MGCP_OSMUX_BSC_NAT:
+ case MGCP_RTP_OSMUX:
default:
LOGPCONN(conn_rtp_src->conn, DRTP, LOGL_ERROR,
"Forward of IuUP payload to RTP connection type %u not supported!\n",
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index a3c245a..5246160 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -1013,10 +1013,9 @@
"using mgcp_send() to forward data directly\n");
return mgcp_send(endp, proto == MGCP_PROTO_RTP,
mc->from_addr, msg, conn_src, conn_dst);
- case MGCP_OSMUX_BSC_NAT:
- case MGCP_OSMUX_BSC:
+ case MGCP_RTP_OSMUX:
LOGPENDP(endp, DRTP, LOGL_DEBUG,
- "endpoint type is MGCP_OSMUX_BSC_NAT, "
+ "endpoint type is MGCP_RTP_OSMUX, "
"using osmux_xfrm_to_osmux() to forward data through OSMUX\n");
return osmux_xfrm_to_osmux((char*)msgb_data(msg), msgb_length(msg), conn_dst);
case MGCP_RTP_IUUP:
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 85ba655b..abd4f32 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -611,7 +611,7 @@
conn->osmux.local_cid = (uint8_t) osmux_cid;
conn->osmux.local_cid_allocated = true;
- conn->type = MGCP_OSMUX_BSC;
+ conn->type = MGCP_RTP_OSMUX;
return osmux_cid;
}
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 711ca31..79fbc53 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -150,8 +150,7 @@
switch (conn->type) {
case MGCP_RTP_DEFAULT:
- case MGCP_OSMUX_BSC:
- case MGCP_OSMUX_BSC_NAT:
+ case MGCP_RTP_OSMUX:
case MGCP_RTP_IUUP:
break;
default:
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29568
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I65effeddf033eb1955553e8d659c593b4e67f7bc
Gerrit-Change-Number: 29568
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29531 )
Change subject: osmux: Drop logging of osmux internal counters
......................................................................
osmux: Drop logging of osmux internal counters
This way we have no more access to internal osmux structures.
Moreover, we already have similar information in our rate_ctrs, so
there's no need to print those there.
Change-Id: I853e118f843070ea29b19e1b0fe56b52f267437a
---
M src/libosmo-mgcp/mgcp_osmux.c
1 file changed, 0 insertions(+), 7 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 5c3ddbf..b8a1c4b 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -136,13 +136,6 @@
LOGP(DOSMUX, LOGL_INFO,
"Releasing unused osmux handle for %s\n",
osmo_sockaddr_to_str(&h->rem_addr));
- LOGP(DOSMUX, LOGL_INFO, "Stats: "
- "input RTP msgs: %u bytes: %"PRIu64" "
- "output osmux msgs: %u bytes: %"PRIu64"\n",
- in->stats.input_rtp_msgs,
- in->stats.input_rtp_bytes,
- in->stats.output_osmux_msgs,
- in->stats.output_osmux_bytes);
llist_del(&h->head);
TALLOC_FREE(h->in);
talloc_free(h);
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29531
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I853e118f843070ea29b19e1b0fe56b52f267437a
Gerrit-Change-Number: 29531
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29568 )
Change subject: osmux: Unify rtp_conn osmux type into a single type
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29568
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I65effeddf033eb1955553e8d659c593b4e67f7bc
Gerrit-Change-Number: 29568
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 04 Oct 2022 10:53:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment