enb,erab: fix error handling when setting up ERABs

when handling ERAB setup requests from MME, don't add the ERAB
before all checks have been performed, otherwise the ERAB
needs to be removed again.

Since this was not the case, invalid NAS PDUs have been transmitted.

Also raise error level for some events to error since the eNB
misses a config or is mal-configured and cant recover from that.
master
Andre Puschmann 3 years ago
parent b127327684
commit c9478a4306

@ -258,19 +258,14 @@ int bearer_cfg_handler::add_erab(uint8_t
}
const rrc_cfg_qci_t& qci_cfg = qci_it->second;
erabs[erab_id].id = erab_id;
erabs[erab_id].lcid = lcid;
erabs[erab_id].qos_params = qos;
erabs[erab_id].address = addr;
erabs[erab_id].teid_out = teid_out;
// perform checks on QCI config
if (addr.length() > 32) {
logger->error("Only addresses with length <= 32 are supported");
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::invalid_qos_combination;
return SRSRAN_ERROR;
}
if (qos.gbr_qos_info_present and not qci_cfg.configured) {
logger->warning("Provided E-RAB id=%d QoS not supported", erab_id);
logger->error("Provided E-RAB id=%d QoS not supported", erab_id);
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::invalid_qos_combination;
return SRSRAN_ERROR;
}
@ -280,21 +275,28 @@ int bearer_cfg_handler::add_erab(uint8_t
int16_t pbr_kbps = qci_cfg.lc_cfg.prioritised_bit_rate.to_number();
uint64_t pbr = pbr_kbps < 0 ? std::numeric_limits<uint64_t>::max() : pbr_kbps * 1000u;
if (req_bitrate > pbr) {
logger->warning("Provided E-RAB id=%d QoS not supported (guaranteed bitrates)", erab_id);
logger->error("Provided E-RAB id=%d QoS not supported (guaranteed bitrates)", erab_id);
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::invalid_qos_combination;
return SRSRAN_ERROR;
}
}
if (qos.alloc_retention_prio.pre_emption_cap.value == asn1::s1ap::pre_emption_cap_opts::may_trigger_pre_emption and
qos.alloc_retention_prio.prio_level < qci_cfg.lc_cfg.prio) {
logger->warning("Provided E-RAB id=%d QoS not supported (priority %d < %d)",
erab_id,
qos.alloc_retention_prio.prio_level,
qci_cfg.lc_cfg.prio);
logger->error("Provided E-RAB id=%d QoS not supported (priority %d < %d)",
erab_id,
qos.alloc_retention_prio.prio_level,
qci_cfg.lc_cfg.prio);
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::invalid_qos_combination;
return SRSRAN_ERROR;
}
// Consider ERAB as accepted
erabs[erab_id].id = erab_id;
erabs[erab_id].lcid = lcid;
erabs[erab_id].qos_params = qos;
erabs[erab_id].address = addr;
erabs[erab_id].teid_out = teid_out;
if (not nas_pdu.empty()) {
erab_info_list[erab_id].assign(nas_pdu.begin(), nas_pdu.end());
logger->info(

@ -1163,11 +1163,13 @@ int rrc::ue::setup_erab(uint16_t erab_
return SRSRAN_ERROR;
}
if (bearer_list.add_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);
return SRSRAN_ERROR;
}
if (bearer_list.add_gtpu_bearer(erab_id) != SRSRAN_SUCCESS) {
cause.set_radio_network().value = asn1::s1ap::cause_radio_network_opts::radio_res_not_available;
bearer_list.release_erab(erab_id);
parent->logger.error("Couldn't add E-RAB id=%d for rnti=0x%x", erab_id, rnti);
return SRSRAN_ERROR;
}
return SRSRAN_SUCCESS;

Loading…
Cancel
Save