Skip to content

Commit

Permalink
[AMF] fix the bug for making allowed NSSAI (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
acetcom committed Jul 1, 2021
1 parent ec377a8 commit 65e96dd
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 5 deletions.
47 changes: 46 additions & 1 deletion src/amf/context.c
Expand Up @@ -1050,6 +1050,28 @@ void amf_ue_new_guti(amf_ue_t *amf_ue)
return;
}

/*
* TS24.501
* 5.3.3 Temporary identities
*
* The AMF shall assign a new 5G-GUTI for a particular UE:
*
* a) during a successful initial registration procedure;
* b) during a successful registration procedure
* for mobility registration update; and
* c) after a successful service request procedure invoked
* as a response to a paging request from the network and
* before the release of the N1 NAS signalling connection
* as specified in subclause 5.4.4.1.
*
* The AMF should assign a new 5G-GUTI for a particular UE
* during a successful registration procedure
* for periodic registration update.
*
* The AMF may assign a new 5G-GUTI at any time for a particular UE
* by performing the generic UE configuration update procedure.
*/

memset(&amf_ue->next.guti, 0, sizeof(ogs_nas_5gs_guti_t));

ogs_assert(amf_ue->guami);
Expand All @@ -1075,6 +1097,28 @@ void amf_ue_confirm_guti(amf_ue_t *amf_ue)
ogs_assert(amf_m_tmsi_free(amf_ue->current.m_tmsi) == OGS_OK);
}

/*
* TS24.501
* 5.3.3 Temporary identities
*
* The AMF shall assign a new 5G-GUTI for a particular UE:
*
* a) during a successful initial registration procedure;
* b) during a successful registration procedure
* for mobility registration update; and
* c) after a successful service request procedure invoked
* as a response to a paging request from the network and
* before the release of the N1 NAS signalling connection
* as specified in subclause 5.4.4.1.
*
* The AMF should assign a new 5G-GUTI for a particular UE
* during a successful registration procedure
* for periodic registration update.
*
* The AMF may assign a new 5G-GUTI at any time for a particular UE
* by performing the generic UE configuration update procedure.
*/

/* Copying from Current to Next Guti */
amf_ue->current.m_tmsi = amf_ue->next.m_tmsi;
memcpy(&amf_ue->current.guti,
Expand Down Expand Up @@ -2197,7 +2241,8 @@ void amf_update_allowed_nssai(amf_ue_t *amf_ue)
for (i = 0; i < amf_ue->num_of_slice; i++) {
ogs_slice_data_t *slice = &amf_ue->slice[i];
ogs_nas_s_nssai_ie_t *allowed =
&amf_ue->allowed_nssai.s_nssai[i];
&amf_ue->allowed_nssai.
s_nssai[amf_ue->allowed_nssai.num_of_s_nssai];

if (slice->default_indicator == true) {
allowed->sst = slice->s_nssai.sst;
Expand Down
22 changes: 21 additions & 1 deletion src/amf/gmm-handler.c
Expand Up @@ -211,7 +211,27 @@ int gmm_handle_registration_request(amf_ue_t *amf_ue,
amf_ue->nhcc = 1;
}

/* Create New GUTI */
/*
* TS24.501
* 5.3.3 Temporary identities
*
* The AMF shall assign a new 5G-GUTI for a particular UE:
*
* a) during a successful initial registration procedure;
* b) during a successful registration procedure
* for mobility registration update; and
* c) after a successful service request procedure invoked
* as a response to a paging request from the network and
* before the release of the N1 NAS signalling connection
* as specified in subclause 5.4.4.1.
*
* The AMF should assign a new 5G-GUTI for a particular UE
* during a successful registration procedure
* for periodic registration update.
*
* The AMF may assign a new 5G-GUTI at any time for a particular UE
* by performing the generic UE configuration update procedure.
*/
amf_ue_new_guti(amf_ue);

ogs_debug(" OLD TAI[PLMN_ID:%06x,TAC:%d]",
Expand Down
44 changes: 42 additions & 2 deletions src/amf/gmm-sm.c
Expand Up @@ -305,7 +305,27 @@ static void common_register_state(ogs_fsm_t *s, amf_event_t *e)
case OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE:
ogs_debug("[%s] Configuration update complete", amf_ue->supi);

/* Confirm GUTI */
/*
* TS24.501
* 5.3.3 Temporary identities
*
* The AMF shall assign a new 5G-GUTI for a particular UE:
*
* a) during a successful initial registration procedure;
* b) during a successful registration procedure
* for mobility registration update; and
* c) after a successful service request procedure invoked
* as a response to a paging request from the network and
* before the release of the N1 NAS signalling connection
* as specified in subclause 5.4.4.1.
*
* The AMF should assign a new 5G-GUTI for a particular UE
* during a successful registration procedure
* for periodic registration update.
*
* The AMF may assign a new 5G-GUTI at any time for a particular UE
* by performing the generic UE configuration update procedure.
*/
if (amf_ue->next.m_tmsi) {
amf_ue_confirm_guti(amf_ue);
} else {
Expand Down Expand Up @@ -988,7 +1008,27 @@ void gmm_state_initial_context_setup(ogs_fsm_t *s, amf_event_t *e)

CLEAR_AMF_UE_TIMER(amf_ue->t3550);

/* Confirm GUTI */
/*
* TS24.501
* 5.3.3 Temporary identities
*
* The AMF shall assign a new 5G-GUTI for a particular UE:
*
* a) during a successful initial registration procedure;
* b) during a successful registration procedure
* for mobility registration update; and
* c) after a successful service request procedure invoked
* as a response to a paging request from the network and
* before the release of the N1 NAS signalling connection
* as specified in subclause 5.4.4.1.
*
* The AMF should assign a new 5G-GUTI for a particular UE
* during a successful registration procedure
* for periodic registration update.
*
* The AMF may assign a new 5G-GUTI at any time for a particular UE
* by performing the generic UE configuration update procedure.
*/
if (amf_ue->next.m_tmsi) {
amf_ue_confirm_guti(amf_ue);
} else {
Expand Down
22 changes: 21 additions & 1 deletion src/amf/ngap-handler.c
Expand Up @@ -923,7 +923,27 @@ void ngap_handle_initial_context_setup_response(
if (paging_ongoing == true) {
gmm_configuration_update_command_param_t param;

/* Create New GUTI */
/*
* TS24.501
* 5.3.3 Temporary identities
*
* The AMF shall assign a new 5G-GUTI for a particular UE:
*
* a) during a successful initial registration procedure;
* b) during a successful registration procedure
* for mobility registration update; and
* c) after a successful service request procedure invoked
* as a response to a paging request from the network and
* before the release of the N1 NAS signalling connection
* as specified in subclause 5.4.4.1.
*
* The AMF should assign a new 5G-GUTI for a particular UE
* during a successful registration procedure
* for periodic registration update.
*
* The AMF may assign a new 5G-GUTI at any time for a particular UE
* by performing the generic UE configuration update procedure.
*/
amf_ue_new_guti(amf_ue);

memset(&param, 0, sizeof(param));
Expand Down

0 comments on commit 65e96dd

Please sign in to comment.