Fix a enb crash when no more users could be added into the bearer manager map.

This was caused by not removing old user from the map, so add the code to cleanup the map on user removal.
master
faluco 3 years ago committed by faluco
parent f382a7c7db
commit 5703752faa

@ -118,6 +118,10 @@ void enb_bearer_manager::add_eps_bearer(uint16_t rnti, uint8_t eps_bearer_id, sr
if (user_it == users_map.end()) { if (user_it == users_map.end()) {
// add empty bearer map // add empty bearer map
auto p = users_map.insert(rnti, srsran::detail::ue_bearer_manager_impl{}); auto p = users_map.insert(rnti, srsran::detail::ue_bearer_manager_impl{});
if (!p) {
logger.error("Bearers: Unable to add a new bearer map for rnti=0x%x", rnti);
return;
}
user_it = p.value(); user_it = p.value();
} }
@ -149,7 +153,14 @@ void enb_bearer_manager::remove_eps_bearer(uint16_t rnti, uint8_t eps_bearer_id)
void enb_bearer_manager::rem_user(uint16_t rnti) void enb_bearer_manager::rem_user(uint16_t rnti)
{ {
auto user_it = users_map.find(rnti);
if (user_it == users_map.end()) {
logger.error("Bearers: No EPS bearer registered for rnti=0x%x", rnti);
return;
}
logger.info("Bearers: Removed rnti=0x%x from EPS bearer manager", rnti); logger.info("Bearers: Removed rnti=0x%x from EPS bearer manager", rnti);
users_map.erase(user_it);
} }
bool enb_bearer_manager::has_active_radio_bearer(uint16_t rnti, uint32_t eps_bearer_id) bool enb_bearer_manager::has_active_radio_bearer(uint16_t rnti, uint32_t eps_bearer_id)

Loading…
Cancel
Save