[PATCH 2/3] Fix RTCP port allocation

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/OpenBSC@lists.osmocom.org/.

msuraev at sysmocom.de msuraev at sysmocom.de
Fri Apr 29 10:39:34 UTC 2016


From: Max <msuraev at sysmocom.de>

Force use of random RTCP port if random RTP port is used. Before port 0
could be selected for RTCP.
---
 src/trau/osmo_ortp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index 22c5856..5ab5bf5 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -357,7 +357,8 @@ int osmo_rtp_socket_bind(struct osmo_rtp_socket *rs, const char *ip, int port)
 {
 	int rc;
 #if HAVE_ORTP_021
-	rc = rtp_session_set_local_addr(rs->sess, ip, port, port+1);
+	int rtcp = (-1 != port) ? port + 1 : -1;
+	rc = rtp_session_set_local_addr(rs->sess, ip, port, rtcp);
 #else
 	rc = rtp_session_set_local_addr(rs->sess, ip, port);
 #endif
-- 
2.8.1




More information about the OpenBSC mailing list