falconia submitted this change.

View Change


Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve
rtp2trau_hr16: set D bits correctly

The original code failed to do the step of osmo_pbit2ubit() for
transferring HRv1 payload bits from packed to unpacked form,
instead doing the bogon of memcpy()ing the RTP payload directly
into tf->d_bits array - fix it. Also set all D bits to zeros
in the case of empty payload input - not ideal, but better than
transmitting uninitialized memory content.

Change-Id: Icb6a21a12fe82f6637f327d45bd843686a90a458
---
M src/trau/trau_rtp_conv.c
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c
index 4a62cc0..cf8d12e 100644
--- a/src/trau/trau_rtp_conv.c
+++ b/src/trau/trau_rtp_conv.c
@@ -425,7 +425,9 @@
tf->ufi = 1;
/* CRC is computed by TRAU frame encoder */
if (data_len)
- memcpy(tf->d_bits, data, GSM_HR_BYTES);
+ osmo_pbit2ubit(tf->d_bits, data, GSM_HR_BYTES * 8);
+ else
+ memset(tf->d_bits, 0, GSM_HR_BYTES * 8);

return 0;
}

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

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Icb6a21a12fe82f6637f327d45bd843686a90a458
Gerrit-Change-Number: 37150
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon@freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged