fixeria submitted this change.

View Change

Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve
l1sap: make send_ul_rtp_packet_hrdata() NULL-safe

lchan->abis_ip.rtp_socket is NULL before the BSC indicates the RTP
parameters using the CRCX/MDCX procedures. send_ul_rtp_packet()
does check lchan->abis_ip.rtp_socket against NULL before calling
osmo_rtp_send_frame_ext(), so should send_ul_rtp_packet_hrdata().

Take a chance to make send_ul_rtp_packet_hrdata() more consistent
with the send_ul_rtp_packet() by reordering code a bit.

Change-Id: I05d88a739dc54ca68e50d20b2d0d0b097ae8ca4a
Fixes: 59686cd27 ("CSD: implement half-rate modes correctly")
Related: OS#6618
---
M src/common/l1sap.c
1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 06ab051..dc83e77 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -2097,7 +2097,7 @@
if (lchan->abis_ip.osmux.use) {
lchan_osmux_send_frame(lchan, rtp_pl, rtp_pl_len,
fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
- } else if (lchan->abis_ip.rtp_socket) {
+ } else if (lchan->abis_ip.rtp_socket != NULL) {
osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
rtp_pl, rtp_pl_len, fn_ms_adj(fn, lchan), lchan->rtp_tx_marker);
rate_ctr_inc2(bts->ctrs, BTS_CTR_RTP_TX_TOTAL);
@@ -2116,14 +2116,15 @@
{
struct gsm_bts *bts = lchan->ts->trx->bts;

- rate_ctr_inc2(bts->ctrs, BTS_CTR_RTP_TX_TOTAL);
- if (lchan->rtp_tx_marker)
- rate_ctr_inc2(bts->ctrs, BTS_CTR_RTP_TX_MARKER);
-
- osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
- rtp_pl, rtp_pl_len,
- GSM_RTP_DURATION,
- lchan->rtp_tx_marker);
+ if (lchan->abis_ip.rtp_socket != NULL) {
+ osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket,
+ rtp_pl, rtp_pl_len,
+ GSM_RTP_DURATION,
+ lchan->rtp_tx_marker);
+ rate_ctr_inc2(bts->ctrs, BTS_CTR_RTP_TX_TOTAL);
+ if (lchan->rtp_tx_marker)
+ rate_ctr_inc2(bts->ctrs, BTS_CTR_RTP_TX_MARKER);
+ }
/* Only clear the marker bit once we have sent a RTP packet with it */
lchan->rtp_tx_marker = false;
}

To view, visit change 38697. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I05d88a739dc54ca68e50d20b2d0d0b097ae8ca4a
Gerrit-Change-Number: 38697
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>