forked from acouzens/open5gs
[AMF] Accept Deregistration Notification from UDM only for registered UE (#1737)
Add additional check when receiving Deregistration Notification from UDM. UE should already be in registered state before accepting the request and deregistering the UE. Also add additional check that PCF association policy exists before sending a delete request to PCF.
This commit is contained in:
parent
e55d4d8300
commit
51669d73a0
|
@ -565,7 +565,8 @@ int amf_namf_callback_handle_dereg_notify(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if (CM_CONNECTED(amf_ue))
|
if ((CM_CONNECTED(amf_ue)) &&
|
||||||
|
(OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)))
|
||||||
{
|
{
|
||||||
amf_ue->network_initiated_de_reg = true;
|
amf_ue->network_initiated_de_reg = true;
|
||||||
|
|
||||||
|
@ -575,11 +576,14 @@ int amf_namf_callback_handle_dereg_notify(
|
||||||
amf_sbi_send_release_all_sessions(
|
amf_sbi_send_release_all_sessions(
|
||||||
amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE);
|
amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE);
|
||||||
|
|
||||||
if (ogs_list_count(&amf_ue->sess_list) == 0)
|
if ((ogs_list_count(&amf_ue->sess_list) == 0) &&
|
||||||
|
(PCF_AM_POLICY_ASSOCIATED(amf_ue)))
|
||||||
|
{
|
||||||
ogs_assert(true ==
|
ogs_assert(true ==
|
||||||
amf_ue_sbi_discover_and_send(
|
amf_ue_sbi_discover_and_send(
|
||||||
OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL,
|
OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL,
|
||||||
amf_npcf_am_policy_control_build_delete, amf_ue, NULL));
|
amf_npcf_am_policy_control_build_delete, amf_ue, NULL));
|
||||||
|
}
|
||||||
|
|
||||||
OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_de_registered);
|
OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_de_registered);
|
||||||
}
|
}
|
||||||
|
@ -587,6 +591,11 @@ int amf_namf_callback_handle_dereg_notify(
|
||||||
/* TODO: need to page UE */
|
/* TODO: need to page UE */
|
||||||
/*ngap_send_paging(amf_ue);*/
|
/*ngap_send_paging(amf_ue);*/
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||||
|
ogs_error("[%s] Deregistration notification for UE in wrong state", amf_ue->supi);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
memset(&sendmsg, 0, sizeof(sendmsg));
|
memset(&sendmsg, 0, sizeof(sendmsg));
|
||||||
|
|
Loading…
Reference in New Issue