aboutsummaryrefslogtreecommitdiffstats
path: root/src/csn1.cpp
diff options
context:
space:
mode:
authorSaurabh Sharan <saurabh.sharan@radisys.com>2016-03-10 14:15:29 +0530
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-15 10:04:34 +0100
commit656eed59758fdcd51d219070209591597a978e7e (patch)
treeb4f22204d4016a8c531c21c839d5a14bb6ed3692 /src/csn1.cpp
parent173ef90a539dc33bb8fc395c0315320a4525a8d6 (diff)
Fix encoding of padding bits to start with 0 bit
This patch is for fixing encoding of padding bits according to the 3gpp spec 44.060 section 11, wherein it shall always start with 0 bit followed with spare padding bits. During introduction of basic EGPRS feature new hex dump messages from a different working network log were used in Unit test. These exposed the issue of incorrect handling of padding bits encoding in osmo-pcu. Corrections in the existing test vector of rlcmac is also updated. In testsuite tbf appropriate corrections for the Tbftest.err is also done.
Diffstat (limited to 'src/csn1.cpp')
-rw-r--r--src/csn1.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/csn1.cpp b/src/csn1.cpp
index 54cc411..82bf17f 100644
--- a/src/csn1.cpp
+++ b/src/csn1.cpp
@@ -2400,7 +2400,12 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
guint8 bits_to_handle = remaining_bits_len%8;
if (bits_to_handle > 0)
{
- guint8 fl = filler&(0xff>>(8-bits_to_handle));
+ /* section 11 of 44.060
+ * The padding bits may be the 'null' string. Otherwise, the
+ * padding bits starts with bit '0', followed by 'spare padding'
+ * < padding bits > ::= { null | 0 < spare padding > ! < Ignore : 1 bit** = < no string > > } ;
+ */
+ guint8 fl = filler&(0xff>>(8-bits_to_handle + 1));
bitvec_write_field(vector, writeIndex, fl, bits_to_handle);
LOGPC(DCSN1, LOGL_NOTICE, "%u|", fl);
remaining_bits_len -= bits_to_handle;