From 59575b9cde026169d5520955e14599a82a607bb0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 11 Feb 2025 18:54:02 +0100 Subject: [PATCH] Handle PDU session resource setup for existing PDU session 38.413 section 8.2.1.4 says that if PDU session resource setup req contains an existing PDU session, that one should be reported as failed. That is rather complicated for us to do; simply reject all PDU sessions and let the core deal with that. --- openair2/RRC/NR/rrc_gNB_NGAP.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index c1715c438c..a7dc0a4c5f 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -872,6 +872,21 @@ void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t ins return; } + // Reject PDU session if at least one exists already with that ID. + // At least one because marking one as existing, and setting up another, that + // might be more work than is worth it. See 8.2.1.4 in 38.413 + for (int i = 0; i < msg->nb_pdusessions_tosetup; ++i) { + const pdusession_t *p = &msg->pdusession_setup_params[i]; + rrc_pdu_session_param_t *exist = find_pduSession(UE, p->pdusession_id, false /* don't create */); + if (exist) { + LOG_E(NR_RRC, "UE %d: already has existing PDU session %d rejecting PDU Session Resource Setup Request\n", UE->rrc_ue_id, p->pdusession_id); + ngap_cause_t cause = {.type = NGAP_CAUSE_RADIO_NETWORK, .value = NGAP_CAUSE_RADIO_NETWORK_MULTIPLE_PDU_SESSION_ID_INSTANCES}; + send_ngap_pdu_session_setup_resp_fail(instance, msg, cause); + rrc_forward_ue_nas_message(rrc, UE); + return; + } + } + UE->amf_ue_ngap_id = msg->amf_ue_ngap_id; if (!trigger_bearer_setup(rrc, UE, msg->nb_pdusessions_tosetup, msg->pdusession_setup_params, msg->ueAggMaxBitRateDownlink)) {