From 286844b3ddc2ab1835c10e797c8a2be355a3a550 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 13 Nov 2020 12:18:52 +0100 Subject: [PATCH] mac_pdu: reset subheader state when deleting from PDU when packing MAC PDUs, adding a new SDU might fail, for example because RLC couldn't provide a new PDU. The muxer then needs to delete the subheader from the PDU again. When adding a padding BSR at the end, the same subheader is again used to store the BSR, so any state in that subheader should be removed. In the particular case, this was causing an issue when logging a LBSR because the LCG buffer states are printed using the payload buffer, which was still pointing to some memory that was used when trying to add the new RLC PDU in the beginning. --- lib/include/srslte/mac/pdu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/include/srslte/mac/pdu.h b/lib/include/srslte/mac/pdu.h index 0f9659d5a..63d58e527 100644 --- a/lib/include/srslte/mac/pdu.h +++ b/lib/include/srslte/mac/pdu.h @@ -195,6 +195,7 @@ public: nof_subheaders--; } if (cur_idx >= 0) { + subheaders[cur_idx].init(); cur_idx--; } }