[AMF] Do not issue SBI requests to other NF's if RAN UE already disconnected

This commit is contained in:
Bostjan Meglic 2023-03-15 06:31:23 +00:00 committed by Sukchan Lee
parent 3bf6941cc4
commit df25013e54
4 changed files with 47 additions and 25 deletions

View File

@ -909,22 +909,31 @@ int amf_namf_callback_handle_sdm_data_change_notify(
}
if (amf_ue) {
if (amf_ue_is_rat_restricted(amf_ue)) {
/*
* - AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED
* 1. UDM_UECM_DeregistrationNotification
* 2. Deregistration request
* 3. UDM_SDM_Unsubscribe
* 4. UDM_UECM_Deregisration
* 5. PDU session release request
* 6. PDUSessionResourceReleaseCommand +
* PDU session release command
* 7. PDUSessionResourceReleaseResponse
* 8. AM_Policy_Association_Termination
* 9. Deregistration accept
* 10. Signalling Connecion Release
*/
if (CM_CONNECTED(amf_ue)) {
ran_ue_t *ran_ue = ran_ue_cycle(amf_ue->ran_ue);
if ((!ran_ue) || (amf_ue_is_rat_restricted(amf_ue))) {
if (!ran_ue) {
ogs_error("NG context has already been removed");
/* ran_ue is required for amf_ue_is_rat_restricted() */
ogs_error("Not implemented : Use Implicit De-registration");
state = AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED;
}
else {
/*
* - AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED
* 1. UDM_UECM_DeregistrationNotification
* 2. Deregistration request
* 3. UDM_SDM_Unsubscribe
* 4. UDM_UECM_Deregistration
* 5. PDU session release request
* 6. PDUSessionResourceReleaseCommand +
* PDU session release command
* 7. PDUSessionResourceReleaseResponse
* 8. AM_Policy_Association_Termination
* 9. Deregistration accept
* 10. Signalling Connection Release
*/
r = nas_5gs_send_de_registration_request(
amf_ue,
OpenAPI_deregistration_reason_REREGISTRATION_REQUIRED, 0);
@ -932,15 +941,6 @@ int amf_namf_callback_handle_sdm_data_change_notify(
ogs_assert(r != OGS_ERROR);
state = AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED;
} else if (CM_IDLE(amf_ue)) {
ogs_error("Not implemented : Use Implicit De-registration");
state = AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED;
} else {
ogs_fatal("Invalid State");
ogs_assert_if_reached();
}
if (UDM_SDM_SUBSCRIBED(amf_ue)) {

View File

@ -50,6 +50,13 @@ ogs_sbi_request_t *amf_npcf_am_policy_control_build_create(
memset(&ueLocation, 0, sizeof(ueLocation));
memset(&UeAmbr, 0, sizeof(UeAmbr));
ran_ue_t *ran_ue = ran_ue_cycle(amf_ue->ran_ue);
if (!ran_ue) {
ogs_error("NG context has already been removed");
/* ran_ue is required for amf_ue_rat_type() */
goto end;
}
server = ogs_list_first(&ogs_sbi_self()->server_list);
if (!server) {
ogs_error("No server");

View File

@ -56,6 +56,13 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
memset(&header, 0, sizeof(header));
memset(&ueLocation, 0, sizeof(ueLocation));
ran_ue_t *ran_ue = ran_ue_cycle(amf_ue->ran_ue);
if (!ran_ue) {
/* ran_ue is required for amf_ue_rat_type() */
ogs_error("NG context has already been removed");
goto end;
}
SmContextCreateData.serving_nf_id =
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
if (!SmContextCreateData.serving_nf_id) {

View File

@ -32,6 +32,14 @@ int amf_nudm_sdm_handle_provisioned(
SWITCH(recvmsg->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
ran_ue_t *ran_ue = ran_ue_cycle(amf_ue->ran_ue);
if (!ran_ue) {
/* ran_ue is required for amf_ue_is_rat_restricted() */
ogs_error("NG context has already been removed");
return OGS_ERROR;
}
if (recvmsg->AccessAndMobilitySubscriptionData) {
OpenAPI_list_t *gpsiList =
recvmsg->AccessAndMobilitySubscriptionData->gpsis;