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
This commit is contained in:
Andre Puschmann 2020-04-02 22:04:13 +02:00
parent 447c740bb5
commit 70b13198b2
1 changed files with 6 additions and 0 deletions

View File

@ -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));