Follow-up on #2428

This commit is contained in:
Sukchan Lee 2023-07-15 23:30:32 +09:00
parent c43444233b
commit 9ba20f6e22
4 changed files with 32 additions and 25 deletions

View File

@ -421,7 +421,7 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
return OGS_ERROR;
}
ogs_warn("[%d:%d] PDU session establishment reject",
ogs_error("[%d:%d] PDU session establishment reject",
sess->psi, sess->pti);
r = nas_5gs_send_gsm_reject(sess,

View File

@ -152,8 +152,9 @@ int amf_nsmf_pdusession_handle_create_sm_context(
* NOTE : The pkbuf created in the SBI message will be removed
* from ogs_sbi_message_free(), so it must be copied.
*/
ogs_warn("[%d:%d] PDU session establishment reject",
ogs_error("[%d:%d] PDU session establishment reject",
sess->psi, sess->pti);
n1smbuf = ogs_pkbuf_copy(n1smbuf);
ogs_assert(n1smbuf);
r = nas_5gs_send_gsm_reject(sess,
@ -161,6 +162,7 @@ int amf_nsmf_pdusession_handle_create_sm_context(
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
amf_sess_remove(sess);
return OGS_ERROR;
}
}
@ -808,6 +810,7 @@ int amf_nsmf_pdusession_handle_update_sm_context(
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
amf_sess_remove(sess);
return OGS_ERROR;
}
}

View File

@ -938,6 +938,10 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e)
} else {
SWITCH(sbi_message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_DELETE)
if (sess->policy_association_id)
ogs_free(sess->policy_association_id);
sess->policy_association_id = NULL;
if (sbi_message->res_status !=
OGS_SBI_HTTP_STATUS_NO_CONTENT) {
ogs_error("[%s:%d] HTTP response error [%d]",

View File

@ -643,35 +643,35 @@ bool smf_nsmf_handle_update_sm_context(
}
} else if (SmContextUpdateData->is_release == true &&
SmContextUpdateData->release == true) {
if (sess->policy_association_id) {
if (sess->ngap_state.pdu_session_resource_release ==
SMF_NGAP_STATE_DELETE_TRIGGER_UE_REQUESTED) {
/* PCF session context has already been removed */
memset(&sendmsg, 0, sizeof(sendmsg));
/* First of all, it checks for REL_DUE_TO_DUPLICATE_SESSION_ID */
if (sess->ngap_state.pdu_session_resource_release ==
SMF_NGAP_STATE_DELETE_TRIGGER_UE_REQUESTED) {
response = ogs_sbi_build_response(
&sendmsg, OGS_SBI_HTTP_STATUS_NO_CONTENT);
ogs_assert(response);
ogs_assert(true ==
ogs_sbi_server_send_response(stream, response));
} else {
smf_npcf_smpolicycontrol_param_t param;
/* PCF session context has already been removed */
memset(&sendmsg, 0, sizeof(sendmsg));
memset(&param, 0, sizeof(param));
response = ogs_sbi_build_response(
&sendmsg, OGS_SBI_HTTP_STATUS_NO_CONTENT);
ogs_assert(response);
ogs_assert(true ==
ogs_sbi_server_send_response(stream, response));
param.ue_location = true;
param.ue_timezone = true;
} else if (sess->policy_association_id) {
smf_npcf_smpolicycontrol_param_t param;
r = smf_sbi_discover_and_send(
OGS_SBI_SERVICE_TYPE_NPCF_SMPOLICYCONTROL, NULL,
smf_npcf_smpolicycontrol_build_delete,
sess, stream,
OGS_PFCP_DELETE_TRIGGER_AMF_UPDATE_SM_CONTEXT, &param);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
memset(&param, 0, sizeof(param));
}
param.ue_location = true;
param.ue_timezone = true;
r = smf_sbi_discover_and_send(
OGS_SBI_SERVICE_TYPE_NPCF_SMPOLICYCONTROL, NULL,
smf_npcf_smpolicycontrol_build_delete,
sess, stream,
OGS_PFCP_DELETE_TRIGGER_AMF_UPDATE_SM_CONTEXT, &param);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
} else {
ogs_error("No PolicyAssociationId");
smf_sbi_send_sm_context_update_error(