falconia has uploaded this change for review.

View Change

osmo_trau_frame_encode(): fix encoding of 16k O&M frames

The behavior of osmo_trau_frame_encode() for OSMO_TRAU16_FT_OAM
has the same unfortunate (but now officially documented) design
quirk as all other 16k frame types: bits C1..C5 are set internally
by the encoding function and not from caller-supplied fr->c_bits[].
However, there was also a bug: bits C6..C15, which are taken from
fr->c_bits[] for all frame types, were copied from the wrong part
of this fr->c_bits[] array. Fix the latter bug.

Change-Id: Ia366d5b0385b764c492bbed9a030ca27db71fcff
---
M src/trau/trau_frame.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/08/41208/1
diff --git a/src/trau/trau_frame.c b/src/trau/trau_frame.c
index 652c703..ad7a102 100644
--- a/src/trau/trau_frame.c
+++ b/src/trau/trau_frame.c
@@ -397,7 +397,7 @@
/* C1 .. C5 */
memcpy(trau_bits + 17, cbits5, 5);
/* C6 .. C15 */
- memcpy(trau_bits + 17 + 5, fr->c_bits, 15 - 5);
+ memcpy(trau_bits + 17 + 5, fr->c_bits + 5, 15 - 5);

/* D1 .. D255 */
for (i = 32, d_idx = 0; i < 304; i += 16, d_idx += 15) {

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

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ia366d5b0385b764c492bbed9a030ca27db71fcff
Gerrit-Change-Number: 41208
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon@freecalypso.org>