aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-11-11 14:06:52 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-11-16 10:48:25 +0100
commitcca530fbf45888ffa6a79f3d5b33bac8d172fe2d (patch)
treeedfbfe84d368059c06887b15ed18d8746dac6558
parente4fa45b6038c8e3d124185046fd308b3efc56a0c (diff)
RLCMAC_EncDEc: Fix decode of DlEgprsDataBlock without LI
-rw-r--r--library/RLCMAC_EncDec.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index ea93de4b..16291ded 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -619,13 +619,25 @@ RlcmacDlEgprsDataBlock dec__RlcmacDlEgprsDataBlock(const OCTETSTRING& stream)
}
/* RLC blocks at end */
- 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();
- if (length > aligned_buffer.get_read_len())
- length = aligned_buffer.get_read_len();
- ret_val.blocks()[i].payload() = OCTETSTRING(length, aligned_buffer.get_read_data());
- aligned_buffer.increase_pos(length);
+ if (ret_val.e() == true) {
+ EgprsLlcBlock lb;
+ unsigned int length = aligned_buffer.get_read_len();
+ /* LI not present: The Upper Layer PDU that starts with the current RLC data block either
+ * fills the current RLC data block precisely or continues in the following in-sequence RLC
+ * data block */
+ lb.payload() = OCTETSTRING(length, ttcn_buffer.get_read_data());
+ aligned_buffer.increase_pos(length);
+ ret_val.blocks()[0] = lb;
+ } else {
+ /* RLC blocks at end */
+ 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();
+ if (length > aligned_buffer.get_read_len())
+ length = aligned_buffer.get_read_len();
+ ret_val.blocks()[i].payload() = OCTETSTRING(length, aligned_buffer.get_read_data());
+ aligned_buffer.increase_pos(length);
+ }
}
}