forked from acouzens/open5gs
Follow-up on #1797
This commit is contained in:
parent
15680003b5
commit
6d27fbb8cc
|
@ -96,16 +96,16 @@ typedef struct ogs_gtp_xact_s {
|
|||
#define OGS_GTP_MODIFY_QOS_UPDATE ((uint64_t)1<<1)
|
||||
uint64_t update_flags;
|
||||
|
||||
#define OGS_GTP_DELETE_NO_ACTION 1
|
||||
#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2
|
||||
#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3
|
||||
#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4
|
||||
#define OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND 5
|
||||
#define OGS_GTP_DELETE_SEND_S1_REMOVE_AND_UNLINK 6
|
||||
#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7
|
||||
#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE 8
|
||||
#define OGS_GTP_DELETE_UE_CONTEXT_COMPLETE_REMOVE 9
|
||||
#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 10
|
||||
#define OGS_GTP_DELETE_NO_ACTION 1
|
||||
#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2
|
||||
#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3
|
||||
#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4
|
||||
#define OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE 5
|
||||
#define OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK 6
|
||||
#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7
|
||||
#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL 8
|
||||
#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE_ALL 9
|
||||
#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 10
|
||||
|
||||
int delete_action;
|
||||
|
||||
|
|
|
@ -2698,7 +2698,7 @@ int mme_ue_set_imsi(mme_ue_t *mme_ue, char *imsi_bcd)
|
|||
if (SESSION_CONTEXT_IS_AVAILABLE(old_mme_ue)) {
|
||||
ogs_warn("[%s] Trigger OLD Session Remove", mme_ue->imsi_bcd);
|
||||
mme_gtp_send_delete_all_sessions(old_mme_ue,
|
||||
OGS_GTP_DELETE_UE_CONTEXT_REMOVE);
|
||||
OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,9 +41,16 @@ void mme_send_delete_session_or_detach(mme_ue_t *mme_ue)
|
|||
|
||||
/* MME Explicit Detach, ie: O&M Procedures */
|
||||
case MME_DETACH_TYPE_MME_EXPLICIT:
|
||||
ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_EXPLICIT");
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
|
||||
/* HSS Explicit Detach, ie: Subscription Withdrawl Cancel Location */
|
||||
/* HSS Explicit Detach, ie: Subscription Withdrawl Cancel Location
|
||||
*
|
||||
* TS23.401 - V16.10.0
|
||||
* Ch 5.3.8 Detach procedure
|
||||
* Ch 5.3.8.4 HSS-initiated Detach procedure
|
||||
*/
|
||||
case MME_DETACH_TYPE_HSS_EXPLICIT:
|
||||
ogs_debug("Explicit HSS Detach");
|
||||
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
|
||||
|
@ -53,24 +60,39 @@ void mme_send_delete_session_or_detach(mme_ue_t *mme_ue)
|
|||
|
||||
/* MME Implicit Detach, ie: Lost Communication */
|
||||
case MME_DETACH_TYPE_MME_IMPLICIT:
|
||||
ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_IMPLICIT");
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
|
||||
/* HSS Implicit Detach, ie: MME-UPDATE-PROCEDURE */
|
||||
/* HSS Implicit Detach, ie: MME-UPDATE-PROCEDURE
|
||||
*
|
||||
* TS23.401 - V16.10.0
|
||||
* Ch 5.3.2 Attach procedure
|
||||
* Ch 5.3.2.1 E-UTRAN Initial Attach
|
||||
*
|
||||
* 9. The HSS sends Cancel Location (IMSI, Cancellation Type)
|
||||
* to the old MME. The old MME acknowledges with Cancel Location Ack (IMSI)
|
||||
* and removes the MM and bearer contexts. If the ULR-Flags indicates
|
||||
* "Initial-Attach-Indicator" and the HSS has the SGSN registration,
|
||||
* then the HSS sends Cancel Location (IMSI, Cancellation Type)
|
||||
* to the old SGSN. The Cancellation Type indicates the old MME/SGSN
|
||||
* to release the old Serving GW resource.
|
||||
*/
|
||||
case MME_DETACH_TYPE_HSS_IMPLICIT:
|
||||
ogs_debug("Implicit HSS Detach");
|
||||
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
|
||||
if (ECM_IDLE(mme_ue)) {
|
||||
mme_gtp_send_delete_all_sessions(mme_ue,
|
||||
OGS_GTP_DELETE_UE_CONTEXT_COMPLETE_REMOVE);
|
||||
OGS_GTP_DELETE_UE_CONTEXT_REMOVE_ALL);
|
||||
} else {
|
||||
mme_gtp_send_delete_all_sessions(mme_ue,
|
||||
OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND);
|
||||
OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_fatal(" Invalid OGS_NAS_EPS TYPE[%d]", mme_ue->nas_eps.type);
|
||||
ogs_fatal(" Invalid OGS_NAS_EPS TYPE[%d]", mme_ue->detach_type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +103,7 @@ void mme_send_delete_session_or_mme_ue_context_release(mme_ue_t *mme_ue)
|
|||
|
||||
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
|
||||
mme_gtp_send_delete_all_sessions(mme_ue,
|
||||
OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND);
|
||||
OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE);
|
||||
} else {
|
||||
enb_ue_t *enb_ue = enb_ue_cycle(mme_ue->enb_ue);
|
||||
if (enb_ue) {
|
||||
|
|
|
@ -592,7 +592,7 @@ void mme_s11_handle_delete_session_response(
|
|||
CLEAR_SGW_S1U_PATH(sess);
|
||||
return;
|
||||
|
||||
} else if (action == OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND) {
|
||||
} else if (action == OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE) {
|
||||
if (mme_sess_count(mme_ue) == 1) /* Last Session */ {
|
||||
enb_ue_t *enb_ue = NULL;
|
||||
|
||||
|
@ -606,7 +606,8 @@ void mme_s11_handle_delete_session_response(
|
|||
ogs_error("ENB-S1 Context has already been removed");
|
||||
}
|
||||
|
||||
} else if (action == OGS_GTP_DELETE_SEND_S1_REMOVE_AND_UNLINK) {
|
||||
} else if (action ==
|
||||
OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK) {
|
||||
if (mme_sess_count(mme_ue) == 1) /* Last Session */ {
|
||||
enb_ue_t *enb_ue = NULL;
|
||||
|
||||
|
@ -633,13 +634,13 @@ void mme_s11_handle_delete_session_response(
|
|||
}
|
||||
}
|
||||
|
||||
} else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE) {
|
||||
} else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL) {
|
||||
|
||||
/* Remove MME-UE Context with Session Context since IMSI duplicated */
|
||||
mme_ue_remove(mme_ue);
|
||||
return;
|
||||
|
||||
} else if (action == OGS_GTP_DELETE_UE_CONTEXT_COMPLETE_REMOVE) {
|
||||
} else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE_ALL) {
|
||||
/* Remove MME-UE Context and hash after Implicit Detach */
|
||||
mme_ue_hash_remove(mme_ue);
|
||||
mme_ue_remove(mme_ue);
|
||||
|
|
|
@ -202,12 +202,7 @@ void mme_s6a_handle_clr(mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message)
|
|||
|
||||
ogs_debug(" OGS_NAS_EPS TYPE[%d]", mme_ue->nas_eps.type);
|
||||
|
||||
if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_de_registered)) {
|
||||
/* Remove all trace of subscriber even when detached. */
|
||||
mme_ue_hash_remove(mme_ue);
|
||||
mme_ue_remove(mme_ue);
|
||||
return;
|
||||
} else if (clr_message->cancellation_type ==
|
||||
if (clr_message->cancellation_type ==
|
||||
OGS_DIAM_S6A_CT_MME_UPDATE_PROCEDURE) {
|
||||
mme_ue->detach_type = MME_DETACH_TYPE_HSS_IMPLICIT;
|
||||
if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
|
||||
|
|
Loading…
Reference in New Issue