<p>pespin <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/21305">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">csn1: Fix readIndex pointer change in CSN_VARIABLE_ARRAY<br><br>There's actually 3 errors:<br>* Its value should be updated, not the pointer itself<br>* Value should be increased, not decreased<br>* bitvec_read_field() API is already advancing it, no need to do it<br><br>Fixes: OS#4838<br>Change-Id: I009abc373794e148091e637ffee80c6461960945<br>---<br>M src/csn1.c<br>M tests/rlcmac/RLCMACTest.cpp<br>M tests/rlcmac/RLCMACTest.err<br>M tests/rlcmac/RLCMACTest.ok<br>4 files changed, 11 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/csn1.c b/src/csn1.c</span><br><span>index fa29e27..da67494 100644</span><br><span>--- a/src/csn1.c</span><br><span>+++ b/src/csn1.c</span><br><span>@@ -1216,7 +1216,6 @@</span><br><span> </span><br><span>           while (count > 0)</span><br><span>           {</span><br><span style="color: hsl(0, 100%, 40%);">-            readIndex -= 8;</span><br><span>        *pui8 = bitvec_read_field(vector, readIndex, 8);</span><br><span>             LOGPC(DCSN1, LOGL_DEBUG, "%s = %u | ", pDescr->sz , (unsigned)*pui8);</span><br><span>             pui8++;</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.cpp b/tests/rlcmac/RLCMACTest.cpp</span><br><span>index f1b6508..140b2f2 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.cpp</span><br><span>+++ b/tests/rlcmac/RLCMACTest.cpp</span><br><span>@@ -110,6 +110,7 @@</span><br><span>         "4913e00850884013a8048b2b2b2b2b2b2b2b2b2b2b2b2b", // Polling Request (malformed)</span><br><span>   "412430007fffffffffffffffefd19c7ba12b2b2b2b2b2b", // Packet Uplink Ack Nack?</span><br><span>       "41942b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b", // System Info 13?</span><br><span style="color: hsl(120, 100%, 40%);">+        "40883c1493120000000012002b2b2b2b2b2b2b2b2b2b2b", // Pkt Paging Request (OS#4838)</span><br><span>  };</span><br><span> </span><br><span>       int testDataSize = sizeof(testData)/sizeof(testData[0]);</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.err b/tests/rlcmac/RLCMACTest.err</span><br><span>index 661f37b..8855110 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.err</span><br><span>+++ b/tests/rlcmac/RLCMACTest.err</span><br><span>@@ -18,6 +18,8 @@</span><br><span> DCSN1 INFO csnStreamEncoder (type: Pkt UL ACK/NACK (9)): MESSAGE_TYPE = 9 | PAGE_MODE = 0 | 0x00 = 0 | UPLINK_TFI = 24 | u.PU_AckNack_GPRS_Struct = 0 |  : u.PU_AckNack_GPRS_Struct | CHANNEL_CODING_COMMAND = 0 |  : Ack_Nack_Description | FINAL_ACK_INDICATION = 0 | STARTING_SEQUENCE_NUMBER = 1 | RECEIVED_BLOCK_BITMAP[0] = 255 | RECEIVED_BLOCK_BITMAP[1] = 255 | RECEIVED_BLOCK_BITMAP[2] = 255 | RECEIVED_BLOCK_BITMAP[3] = 255 | RECEIVED_BLOCK_BITMAP[4] = 255 | RECEIVED_BLOCK_BITMAP[5] = 255 | RECEIVED_BLOCK_BITMAP[6] = 255 | RECEIVED_BLOCK_BITMAP[7] = 255 |  : End Ack_Nack_Description | Common_Uplink_Ack_Nack_Data.Exist_CONTENTION_RESOLUTION_TLLI = 1 | Common_Uplink_Ack_Nack_Data.CONTENTION_RESOLUTION_TLLI = 2123162589 | Common_Uplink_Ack_Nack_Data.Exist_Packet_Timing_Advance = 0 | Common_Uplink_Ack_Nack_Data.Exist_Power_Control_Parameters = 0 | Common_Uplink_Ack_Nack_Data.Exist_Extension_Bits = 0 | u.FixedAllocationDummy = 0 | u.FixedAllocationDummy = 1 | Exist_AdditionsR99 = 0 |  : End u.PU_AckNack_GPRS_Struct | Padding = 43|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamDecoder (type: Pkt DL Dummy Ctrl Block (37): MESSAGE_TYPE = 37 | PAGE_MODE = 0 | Exist_PERSISTENCE_LEVEL = 0 | Padding = 43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamEncoder (type: Pkt DL Dummy Ctrl Block (37)): MESSAGE_TYPE = 37 | PAGE_MODE = 0 | Exist_PERSISTENCE_LEVEL = 0 | Padding = 43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|</span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamDecoder (type: Pkt Paging Request (34): MESSAGE_TYPE = 34 | PAGE_MODE = 0 | Exist_PERSISTENCE_LEVEL = 0 | Exist_NLN = 0 | Repeated_Page_info = Exist | u.Page_req_RR = 1 |  : u.Page_req_RR | u.Mobile_Identity = 1 |  : u.Mobile_Identity | Length_of_Mobile_Identity_contents = 8 | Mobile_Identity = 41 | Mobile_Identity = 38 | Mobile_Identity = 36 | Mobile_Identity = 0 | Mobile_Identity = 0 | Mobile_Identity = 0 | Mobile_Identity = 0 | Mobile_Identity = 36 |  : End u.Mobile_Identity | CHANNEL_NEEDED = 0 | Exist_eMLPP_PRIORITY = 0 |  : End u.Page_req_RR | Repeated_Page_info = 0 | Padding = 0|43|43|43|43|43|43|43|43|43|43|43|</span><br><span style="color: hsl(120, 100%, 40%);">+DCSN1 INFO csnStreamEncoder (type: Pkt Paging Request (34)): MESSAGE_TYPE = 34 | PAGE_MODE = 0 | Exist_PERSISTENCE_LEVEL = 0 | Exist_NLN = 0 | Repeated_Page_info = 1 | u.Page_req_RR = 1 |  : u.Page_req_RR | u.Mobile_Identity = 1 |  : u.Mobile_Identity | Length_of_Mobile_Identity_contents = 8 | Mobile_Identity = 41 | Mobile_Identity = 38 | Mobile_Identity = 36 | Mobile_Identity = 0 | Mobile_Identity = 0 | Mobile_Identity = 0 | Mobile_Identity = 0 | Mobile_Identity = 36 |  : End u.Mobile_Identity | CHANNEL_NEEDED = 0 | Exist_eMLPP_PRIORITY = 0 |  : End u.Page_req_RR | Repeated_Page_info = 0 | Padding = 3|43|43|43|43|43|43|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamDecoder (type: Pkt UL Dummy Ctrl Block (3)): PayloadType = 1 | spare = 0 | R = 0 | MESSAGE_TYPE = 3 | TLLI = 0x87987447 | Padding = 1|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamEncoder (type: Pkt UL Dummy Ctrl Block (3)): PayloadType = 1 | spare = 0 | R = 0 | MESSAGE_TYPE = 3 | TLLI = 2274915399 | Padding = 1|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|43|</span><br><span> DCSN1 INFO csnStreamDecoder (type: Pkt DL ACK/NACK (2)): PayloadType = 1 | spare = 0 | R = 0 | MESSAGE_TYPE = 2 | DOWNLINK_TFI = 28 |  : Ack_Nack_Description | FINAL_ACK_INDICATION = 0 | STARTING_SEQUENCE_NUMBER = 1 | RECEIVED_BLOCK_BITMAP[0] = 0 | RECEIVED_BLOCK_BITMAP[1] = 0 | RECEIVED_BLOCK_BITMAP[2] = 0 | RECEIVED_BLOCK_BITMAP[3] = 0 | RECEIVED_BLOCK_BITMAP[4] = 0 | RECEIVED_BLOCK_BITMAP[5] = 0 | RECEIVED_BLOCK_BITMAP[6] = 0 | RECEIVED_BLOCK_BITMAP[7] = 1 | : End Ack_Nack_Description | Exist_Channel_Request_Description = 0 |  : Channel_Quality_Report | C_VALUE = 18 | RXQUAL = 0 | SIGN_VAR = 7 | Slot[0].Exist = 0 | Slot[1].Exist = 0 | Slot[2].Exist = 0 | Slot[3].Exist = 0 | Slot[4].Exist = 0 | Slot[5].Exist = 0 | Slot[6].Exist = 0 | Slot[7].Exist = 0 | : End Channel_Quality_Report | Exist_AdditionsR99 = 0 | Padding = 3|43|43|43|43|43|43|43|43|</span><br><span>diff --git a/tests/rlcmac/RLCMACTest.ok b/tests/rlcmac/RLCMACTest.ok</span><br><span>index 861b1b9..437cd75 100644</span><br><span>--- a/tests/rlcmac/RLCMACTest.ok</span><br><span>+++ b/tests/rlcmac/RLCMACTest.ok</span><br><span>@@ -80,6 +80,14 @@</span><br><span> vector1 = 41 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b </span><br><span> vector2 = 41 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b </span><br><span> vector1 == vector2 : TRUE</span><br><span style="color: hsl(120, 100%, 40%);">+vector1 = 40883c1493120000000012002b2b2b2b2b2b2b2b2b2b2b</span><br><span style="color: hsl(120, 100%, 40%);">+=========Start DECODE===========</span><br><span>++++++++++Finish DECODE (0)++++++++++</span><br><span style="color: hsl(120, 100%, 40%);">+=========Start ENCODE=============</span><br><span>++++++++++Finish ENCODE (0)+++++++++++</span><br><span style="color: hsl(120, 100%, 40%);">+vector1 = 40 88 3c 14 93 12 00 00 00 00 12 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b </span><br><span style="color: hsl(120, 100%, 40%);">+vector2 = 40 88 3c 14 93 12 00 00 00 00 12 01 95 95 95 95 95 95 95 95 95 95 95 </span><br><span style="color: hsl(120, 100%, 40%);">+vector1 == vector2 : FALSE</span><br><span> *** testRlcMacUplink ***</span><br><span>  UPLINK </span><br><span> vector1 = 400e1e61d11d2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/21305">change 21305</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-pcu/+/21305"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I009abc373794e148091e637ffee80c6461960945 </div>
<div style="display:none"> Gerrit-Change-Number: 21305 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>