pespin submitted this change.

View Change

Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified
RLCMAC_EncDec: Fix bug decoding LI[0]=0

Change-Id: I86c1b48c922f50013257c8dce405cbad1d77d868
---
M library/RLCMAC_EncDec.cc
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index 97bd0be..1b56984 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -513,8 +513,17 @@
if (ret_val.blocks().is_bound()) {
for (int i = 0; i < ret_val.blocks().size_of(); i++) {
unsigned int length = ret_val.blocks()[i].hdr()().length__ind();
+
+ /* LI[0]=0 indicates: The current LLC PDU would fit within
+ current RLC data block but the addition of the length
+ indicator octet (to indicate the LLC PDU boundary) causes the
+ LLC PDU to extend into another RLC data block */
+ if (i == 0 && length == 0)
+ length = ttcn_buffer.get_read_len();
+
if (length > ttcn_buffer.get_read_len())
length = ttcn_buffer.get_read_len();
+
ret_val.blocks()[i].payload() = OCTETSTRING(length, ttcn_buffer.get_read_data());
ttcn_buffer.increase_pos(length);
}

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I86c1b48c922f50013257c8dce405cbad1d77d868
Gerrit-Change-Number: 27632
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged