From 2f69acd0ed0ef01a6d1af67b3ed7061b05177d48 Mon Sep 17 00:00:00 2001 From: Ivan Kluchnikov Date: Tue, 12 Jun 2012 12:42:16 +0400 Subject: [PATCH] Modified gprs_rlcmac_data_block_parse() function. Implemented singular case of using Length Indicator field, which described in 10.4.14 TS 44.060. --- gprs_rlcmac.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gprs_rlcmac.cpp b/gprs_rlcmac.cpp index ca949247..955b6b36 100644 --- a/gprs_rlcmac.cpp +++ b/gprs_rlcmac.cpp @@ -437,6 +437,13 @@ void gprs_rlcmac_data_block_parse(gprs_rlcmac_tbf* tbf, RlcMacUplinkDataBlock_t i++; data_block_hdr_len += 1; llc_pdu_num++; + + // Singular case, TS 44.060 10.4.14 + if (ul_data_block->LENGTH_INDICATOR[i] == 0) + { + break; + } + // New LLC PDU starts after the current LLC PDU and continues until // the end of the RLC information field, no more extension octets. if ((ul_data_block->M[i] == 1)&&(ul_data_block->E[i] == 1)) @@ -467,7 +474,15 @@ void gprs_rlcmac_data_block_parse(gprs_rlcmac_tbf* tbf, RlcMacUplinkDataBlock_t { if (ul_data_block->E_1 == 0) // Extension octet follows immediately { - llc_pdu_len = ul_data_block->LENGTH_INDICATOR[num]; + // Singular case, TS 44.060 10.4.14 + if (ul_data_block->LENGTH_INDICATOR[num] == 0) + { + llc_pdu_len = UL_RLC_DATA_BLOCK_LEN - data_block_hdr_len; + } + else + { + llc_pdu_len = ul_data_block->LENGTH_INDICATOR[num]; + } } else {