aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-05-13 17:34:51 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-05-14 11:36:33 +0200
commitdac2ca7e21f2535e493b1b798ad3604d9de7c20e (patch)
treeda6c770e964b9f67015181bc55ed276a937186fc
parent375252279c89842bdc5c70b3f4579120314df389 (diff)
osmux: Delay osmux enable of conn until remote addr is configured by MDCX
-rw-r--r--src/libosmo-mgcp/mgcp_osmux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 442319472..536b65b5b 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -559,6 +559,7 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn,
* overlapping RTP SSRC traveling to the BTSes behind the BSC,
* similarly, for flows traveling to the MSC.
*/
+ struct in_addr addr_unset = {};
static const uint32_t rtp_ssrc_winlen = UINT32_MAX / (OSMUX_CID_MAX + 1);
uint16_t osmux_dummy = endp->cfg->osmux_dummy;
@@ -570,6 +571,13 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn,
return -1;
}
+ /* Wait until we have the connection information from MDCX */
+ if (memcmp(&conn->end.addr, &addr_unset, sizeof(addr_unset)) == 0) {
+ LOGPCONN(conn->conn, DLMGCP, LOGL_INFO,
+ "Osmux remote address/port still unknown\n");
+ return -1;
+ }
+
conn->osmux.in = osmux_handle_lookup(endp->cfg, addr, port);
if (!conn->osmux.in) {
LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR,