From 70b13198b2657caca01ee215da8e6b1e6b542cc6 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 2 Apr 2020 22:04:13 +0200 Subject: [PATCH] pdcp: update local rx_count variable when accepting incoming PDU before the SN was read but the rx_count was never updated. when get_dl_count() or get_bearer_status() were called, invalid values were returned --- lib/src/upper/pdcp_entity_lte.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/upper/pdcp_entity_lte.cc b/lib/src/upper/pdcp_entity_lte.cc index 896c0ba65..c49b4901d 100644 --- a/lib/src/upper/pdcp_entity_lte.cc +++ b/lib/src/upper/pdcp_entity_lte.cc @@ -197,6 +197,8 @@ void pdcp_entity_lte::handle_srb_pdu(srslte::unique_byte_buffer_t pdu) } } + rx_count = sn; + // Discard header discard_data_header(pdu); @@ -232,6 +234,8 @@ void pdcp_entity_lte::handle_um_drb_pdu(srslte::unique_byte_buffer_t pdu) log->debug_hex(pdu->msg, pdu->N_bytes, "%s Rx PDU (decrypted)", rrc->get_rb_name(lcid).c_str()); } + rx_count = sn; + next_pdcp_rx_sn = sn + 1; if (next_pdcp_rx_sn > maximum_pdcp_sn) { next_pdcp_rx_sn = 0; @@ -298,6 +302,8 @@ void pdcp_entity_lte::handle_am_drb_pdu(srslte::unique_byte_buffer_t pdu) // Update info on last PDU submitted to upper layers last_submitted_pdcp_rx_sn = sn; + rx_count = sn; + // Pass to upper layers log->info_hex(pdu->msg, pdu->N_bytes, "%s Rx PDU SN=%d", rrc->get_rb_name(lcid).c_str(), sn); gw->write_pdu(lcid, std::move(pdu));