Compare commits

...

4 Commits

Author SHA1 Message Date
Oliver Smith
9c3fad2c42 Bump version: 1.13.0.3-227a → 1.13.1
Change-Id: I8ebbaf6bff440cb233088f4bc226b80db0fd3922
2024-09-12 13:54:42 +02:00
Pau Espin Pedrol
227a800d26 tests/mgcp/mgcp_test: Add some extra asserts in code
This makes it easier to catch possible failures while running the test,
plus makes gcc on OpenSUSE_Factory happy and not warn.

Related: OS#5044
Change-Id: I01c3c84e58a11055f0e0a6955016dc2489c73379
2024-08-20 12:02:02 +02:00
Philipp Maier
24cae67f3e mgcp_network: add missing ntohs
We must use ntohs before passing the RTCP port to osmo_sockaddr_port

Related: OS#6527
Change-Id: I9773c7b1fda8c9b429723ef9f0db0b58894b28fe
2024-08-07 09:48:45 +02:00
Philipp Maier
0d47c408ac mgcp_network: use an uint16_t to store the port number
The comment in struct mgcp_rtp_end says that the RTCP port number has to
be stored in network byte order. Such a port number is 16 bit long, so
let's use an uint16_t instead of an int here.

Related: OS#6527
Change-Id: I392b07b243389a78d4ad1d784cdfdc28ec59b487
2024-08-07 09:47:42 +02:00
4 changed files with 15 additions and 2 deletions

11
debian/changelog vendored
View File

@@ -1,3 +1,14 @@
osmo-mgw (1.13.1) unstable; urgency=medium
[ Philipp Maier ]
* mgcp_network: use an uint16_t to store the port number
* mgcp_network: add missing ntohs
[ Pau Espin Pedrol ]
* tests/mgcp/mgcp_test: Add some extra asserts in code
-- Oliver Smith <osmith@sysmocom.de> Thu, 12 Sep 2024 13:53:19 +0200
osmo-mgw (1.13.0) unstable; urgency=medium
[ Neels Hofmeyr ]

View File

@@ -94,7 +94,7 @@ struct mgcp_rtp_end {
struct osmo_sockaddr addr;
/* in network byte order */
int rtcp_port;
uint16_t rtcp_port;
/* currently selected audio codec */
struct mgcp_rtp_codec *codec;

View File

@@ -1251,7 +1251,7 @@ int mgcp_send(struct mgcp_endpoint *endp, int is_rtp, struct osmo_sockaddr *addr
return 0;
} else if (!trunk->omit_rtcp) {
struct osmo_sockaddr rtcp_addr = rtp_end->addr;
osmo_sockaddr_set_port(&rtcp_addr.u.sa, rtp_end->rtcp_port);
osmo_sockaddr_set_port(&rtcp_addr.u.sa, ntohs(rtp_end->rtcp_port));
LOGPENDP(endp, DRTP, LOGL_DEBUG,
"send to %s %s rtp_port:%u rtcp_port:%u\n",
dest_name, osmo_sockaddr_ntop(&rtcp_addr.u.sa, ipbuf),

View File

@@ -1208,7 +1208,9 @@ static void test_packet_loss_calc(void)
_conn =
mgcp_conn_alloc(NULL, &endp, MGCP_CONN_TYPE_RTP,
"test-connection");
OSMO_ASSERT(_conn);
conn = mgcp_conn_get_rtp(&endp, _conn->id);
OSMO_ASSERT(conn);
state = &conn->state;
packets_rx = rate_ctr_group_get_ctr(conn->ctrg, RTP_PACKETS_RX_CTR);