diff --git a/src/amf/gmm-handler.c b/src/amf/gmm-handler.c index d7528f37f..a263180f7 100644 --- a/src/amf/gmm-handler.c +++ b/src/amf/gmm-handler.c @@ -664,9 +664,22 @@ int gmm_handle_deregistration_request(amf_ue_t *amf_ue, amf_ue->nas.ue.tsc, amf_ue->nas.amf.tsc, amf_ue->nas.ue.ksi, amf_ue->nas.amf.ksi); - if (deregistration_request->de_registration_type.switch_off) + if (deregistration_request->de_registration_type.switch_off) { ogs_debug(" Switch-Off"); + /* + * Issue #1917 + * + * When the UE sends a De-registration Request with Switch-Off, + * AMF should remove the the stored UE Radio Capability. + * + * Otherwise, the Radio Capability will not match + * because the gNB will not query the Radio Capability + * when the UE changes USIM. + */ + OGS_ASN_CLEAR_DATA(&amf_ue->ueRadioCapability); + } + ogs_info("[%s] SUCI", amf_ue->suci); amf_sbi_send_release_all_sessions( diff --git a/src/mme/emm-handler.c b/src/mme/emm-handler.c index 435887d8f..e25b6d2a0 100644 --- a/src/mme/emm-handler.c +++ b/src/mme/emm-handler.c @@ -423,9 +423,22 @@ int emm_handle_detach_request( default: /* all other values */ break; } - if (detach_request->detach_type.switch_off) + if (detach_request->detach_type.switch_off) { ogs_debug(" Switch-Off"); + /* + * Issue #1917 + * + * When the UE sends a Detach Request with Switch-Off, + * MME should remove the the stored UE Radio Capability. + * + * Otherwise, the Radio Capability will not match + * because the eNB will not query the Radio Capability + * when the UE changes USIM. + */ + OGS_ASN_CLEAR_DATA(&mme_ue->ueRadioCapability); + } + return OGS_OK; }