mux: fix packing of short MAC PDUs

master
Andre Puschmann 6 years ago
parent dffbc4404f
commit 82a69fb51c

@ -101,7 +101,7 @@ public:
if (nof_subheaders > 0) {
nof_subheaders--;
}
if (cur_idx > 0) {
if (cur_idx >= 0) {
cur_idx--;
}
}

@ -126,7 +126,7 @@ uint8_t* sch_pdu::write_packet(srslte::log* log_h)
for (uint32_t i = 0; i < onetwo_padding; i++) {
sch_subh padding;
padding.set_padding();
padding.write_subheader(&ptr, false);
padding.write_subheader(&ptr, pdu_len > onetwo_padding ? false : true);
}
// Then write subheaders for MAC CE

@ -326,13 +326,15 @@ bool mux::allocate_sdu(uint32_t lcid, srslte::sch_pdu* pdu_msg, int max_sdu_sz)
buffer_state = rlc->get_buffer_state(lcid);
} else {
Warning("SDU: rlc_buffer=%d, requested_sdu_len=%d, allocated=%d/%d, remaining=%d\n",
Warning("Couldn't allocate new SDU (rlc_buffer=%d, requested_sdu_len=%d, allocated=%d/%d, remaining=%d)\n",
buffer_state,
requested_sdu_len,
sdu_len,
sdu_space,
pdu_msg->rem_size());
pdu_msg->del_subh();
// prevent endless loop
break;
}
} else {
Debug("Couldn't add new MAC subheader (rlc_buffer=%d, requested_sdu_len=%d, sdu_space=%d, remaining=%d)\n",

Loading…
Cancel
Save