From c015540f54e8b0c9d897b020ede42ca620e21e50 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 6 May 2022 12:35:18 +0100 Subject: [PATCH] lib,pdcp_nr: make sure MAC-I is added on SRBs, even when integrity is not active yet --- lib/src/pdcp/pdcp_entity_nr.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/pdcp/pdcp_entity_nr.cc b/lib/src/pdcp/pdcp_entity_nr.cc index e50f7bfc2..938e78e8f 100644 --- a/lib/src/pdcp/pdcp_entity_nr.cc +++ b/lib/src/pdcp/pdcp_entity_nr.cc @@ -92,8 +92,9 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, int sn) // Log SDU logger.info(sdu->msg, sdu->N_bytes, - "TX %s SDU, integrity=%s, encryption=%s", + "TX %s SDU (%dB), integrity=%s, encryption=%s", rb_name.c_str(), + sdu->N_bytes, srsran_direction_text[integrity_direction], srsran_direction_text[encryption_direction]); @@ -130,7 +131,7 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, int sn) write_data_header(sdu, tx_next); // Append MAC-I - if (is_drb() && (integrity_direction == DIRECTION_TX || integrity_direction == DIRECTION_TXRX)) { + if (is_srb() || (is_drb() && (integrity_direction == DIRECTION_TX || integrity_direction == DIRECTION_TXRX))) { append_mac(sdu, mac); } // Set meta-data for RLC AM @@ -138,8 +139,9 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, int sn) logger.info(sdu->msg, sdu->N_bytes, - "TX %s PDU, HFN=%d, SN=%d, integrity=%s, encryption=%s", + "TX %s PDU (%dB), HFN=%d, SN=%d, integrity=%s, encryption=%s", rb_name.c_str(), + sdu->N_bytes, HFN(tx_next), SN(tx_next), srsran_direction_text[integrity_direction],