lte,enb,rrc: verify the drbtoaddmodlist is correctly updated in the add_erab case, and change the function add_erab to addmod_erab

master
Francisco 3 years ago committed by Francisco Paisana
parent 638dbc6f7e
commit 0dc9cf142a

@ -93,7 +93,7 @@ public:
/// Called after RRCReestablishmentComplete, to add E-RABs of old rnti /// Called after RRCReestablishmentComplete, to add E-RABs of old rnti
void reestablish_bearers(bearer_cfg_handler&& old_rnti_bearers); void reestablish_bearers(bearer_cfg_handler&& old_rnti_bearers);
int add_erab(uint8_t erab_id, int addmod_erab(uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos, const asn1::s1ap::erab_level_qos_params_s& qos,
const asn1::bounded_bitstring<1, 160, true, true>& addr, const asn1::bounded_bitstring<1, 160, true, true>& addr,
uint32_t teid_out, uint32_t teid_out,

@ -212,7 +212,7 @@ void bearer_cfg_handler::reestablish_bearers(bearer_cfg_handler&& old_rnti_beare
old_rnti_bearers.current_drbs.clear(); old_rnti_bearers.current_drbs.clear();
} }
int bearer_cfg_handler::add_erab(uint8_t erab_id, int bearer_cfg_handler::addmod_erab(uint8_t erab_id,
const asn1::s1ap::erab_level_qos_params_s& qos, const asn1::s1ap::erab_level_qos_params_s& qos,
const asn1::bounded_bitstring<1, 160, true, true>& addr, const asn1::bounded_bitstring<1, 160, true, true>& addr,
uint32_t teid_out, uint32_t teid_out,
@ -281,6 +281,16 @@ int bearer_cfg_handler::add_erab(uint8_t
} }
} }
// If it is an E-RAB modification, remove previous DRB object
if (erabs.count(erab_id) > 0) {
for (auto& drb : current_drbs) {
if (drb.eps_bearer_id_present and drb.eps_bearer_id == erab_id) {
srsran::rem_rrc_obj_id(current_drbs, drb.drb_id);
break;
}
}
}
// Consider ERAB as accepted // Consider ERAB as accepted
erabs[erab_id].id = erab_id; erabs[erab_id].id = erab_id;
erabs[erab_id].lcid = lcid; erabs[erab_id].lcid = lcid;
@ -352,7 +362,7 @@ int bearer_cfg_handler::modify_erab(uint8_t e
} }
auto address = erab_it->second.address; auto address = erab_it->second.address;
uint32_t teid_out = erab_it->second.teid_out; uint32_t teid_out = erab_it->second.teid_out;
return add_erab(erab_id, qos, address, teid_out, nas_pdu, cause); return addmod_erab(erab_id, qos, address, teid_out, nas_pdu, cause);
} }
int bearer_cfg_handler::add_gtpu_bearer(uint32_t erab_id) int bearer_cfg_handler::add_gtpu_bearer(uint32_t erab_id)

@ -952,7 +952,7 @@ bool rrc::ue::rrc_mobility::apply_ho_prep_cfg(const ho_prep_info_r8_ies_s&
uint32_t teid_out = 0; uint32_t teid_out = 0;
srsran::uint8_to_uint32(erab.gtp_teid.data(), &teid_out); srsran::uint8_to_uint32(erab.gtp_teid.data(), &teid_out);
asn1::s1ap::cause_c erab_cause; asn1::s1ap::cause_c erab_cause;
if (rrc_ue->bearer_list.add_erab( if (rrc_ue->bearer_list.addmod_erab(
erab.erab_id, erab.erab_level_qos_params, erab.transport_layer_address, teid_out, {}, erab_cause) != erab.erab_id, erab.erab_level_qos_params, erab.transport_layer_address, teid_out, {}, erab_cause) !=
SRSRAN_SUCCESS) { SRSRAN_SUCCESS) {
erabs_failed_to_setup.emplace_back(); erabs_failed_to_setup.emplace_back();

@ -1219,7 +1219,7 @@ int rrc::ue::setup_erab(uint16_t erab_
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::multiple_erab_id_instances; cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::multiple_erab_id_instances;
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
if (bearer_list.add_erab(erab_id, qos_params, addr, gtpu_teid_out, nas_pdu, cause) != SRSRAN_SUCCESS) { if (bearer_list.addmod_erab(erab_id, qos_params, addr, gtpu_teid_out, nas_pdu, cause) != SRSRAN_SUCCESS) {
parent->logger.error("Couldn't add E-RAB id=%d for rnti=0x%x", erab_id, rnti); parent->logger.error("Couldn't add E-RAB id=%d for rnti=0x%x", erab_id, rnti);
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }

Loading…
Cancel
Save