fix PDU Sesion Release response: add missing PDUSessionResourceReleaseResponseTransfer IE

The PDUSessionResourceReleaseResponse message was missing the mandatory
pDUSessionResourceReleaseResponseTransfer IE in each released PDU session item. This caused Open5GS to send an error indication.

Changes:
- Add encode_ngap_pdusession_release_response_transfer() function to
  properly encode the transfer structure (empty since Secondary RAT Usage
  Information is optional and not used, per 9.3.4.21)
- Always include the mandatory PDUSessionResourceReleasedListRelRes IE
- Always encode the pDUSessionResourceReleaseResponseTransfer for each
  PDU session item
- Fix Release Command handler to decode and log Cause from command transfer:
  instead of incorrectly copying command data to response: the 2 transfer
  IEs in the Command and the Response messages are different and should
  not be mixed
- Split Command/Response struct type definitions
- Add missing includes
This commit is contained in:
Guido Casati
2025-12-01 23:48:06 +01:00
parent ad1c92af4f
commit 9e45f38fbd
6 changed files with 60 additions and 24 deletions
+2 -2
View File
@@ -1526,9 +1526,9 @@ int rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(ngap_pdusession_release_comm
cmd->nb_pdusessions_torelease);
e1ap_bearer_mod_req_t req = {0};
for (int pdusession = 0; pdusession < cmd->nb_pdusessions_torelease; pdusession++) {
rrc_pdu_session_param_t *pduSession = find_pduSession(&UE->pduSessions, cmd->pdusession_release_params[pdusession].pdusession_id);
rrc_pdu_session_param_t *pduSession = find_pduSession(&UE->pduSessions, cmd->pdusession_ids[pdusession]);
if (!pduSession) {
LOG_E(NR_RRC, "Failed to release non-existing PDU Session %d\n", cmd->pdusession_release_params[pdusession].pdusession_id);
LOG_E(NR_RRC, "Failed to release non-existing PDU Session %d\n", cmd->pdusession_ids[pdusession]);
continue;
}
if (pduSession->status == PDU_SESSION_STATUS_TORELEASE) {