mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 23:37:22 +00:00
In emm_state_attached state, if NAS MAC is failed, service reject is sent out
This commit is contained in:
parent
1d947c5698
commit
4eb314d781
2 changed files with 51 additions and 7 deletions
|
|
@ -85,7 +85,8 @@ void emm_state_detached(fsm_t *s, event_t *e)
|
|||
else
|
||||
{
|
||||
d_warn("NAS MAC Failure in emm_state_detached");
|
||||
nas_send_service_reject(mme_ue, EMM_CAUSE_MAC_FAILURE);
|
||||
nas_send_service_reject(mme_ue,
|
||||
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
FSM_TRAN(s, &emm_state_exception);
|
||||
}
|
||||
}
|
||||
|
|
@ -274,8 +275,25 @@ void emm_state_identity(fsm_t *s, event_t *e)
|
|||
{
|
||||
if (MME_HAVE_SGW_S11_PATH(mme_ue))
|
||||
{
|
||||
mme_s6a_send_air(mme_ue, NULL);
|
||||
FSM_TRAN(&mme_ue->sm, &emm_state_authentication);
|
||||
S1ap_Cause_t cause;
|
||||
enb_ue_t *enb_ue = NULL;
|
||||
|
||||
d_warn("Have PDN Connection "
|
||||
"in emm_state_attached");
|
||||
nas_send_service_reject(mme_ue,
|
||||
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
|
||||
enb_ue = mme_ue->enb_ue;
|
||||
d_assert(enb_ue, break, "No ENB UE context");
|
||||
|
||||
cause.present = S1ap_Cause_PR_nas;
|
||||
cause.choice.nas = S1ap_CauseNas_normal_release;
|
||||
rv = s1ap_send_ue_context_release_commmand(
|
||||
enb_ue, &cause,
|
||||
S1AP_UE_CTX_REL_NO_ACTION, 0);
|
||||
d_assert(rv == CORE_OK, break,
|
||||
"s1ap send failed");
|
||||
FSM_TRAN(s, &emm_state_attached);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -683,13 +701,28 @@ void emm_state_attached(fsm_t *s, event_t *e)
|
|||
{
|
||||
if (MME_HAVE_SGW_S11_PATH(mme_ue))
|
||||
{
|
||||
mme_s6a_send_air(mme_ue, NULL);
|
||||
FSM_TRAN(&mme_ue->sm, &emm_state_authentication);
|
||||
S1ap_Cause_t cause;
|
||||
enb_ue_t *enb_ue = NULL;
|
||||
|
||||
d_warn("Have PDN Connection in emm_state_attached");
|
||||
nas_send_service_reject(mme_ue,
|
||||
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
|
||||
enb_ue = mme_ue->enb_ue;
|
||||
d_assert(enb_ue, break, "No ENB UE context");
|
||||
|
||||
cause.present = S1ap_Cause_PR_nas;
|
||||
cause.choice.nas = S1ap_CauseNas_normal_release;
|
||||
rv = s1ap_send_ue_context_release_commmand(
|
||||
enb_ue, &cause,
|
||||
S1AP_UE_CTX_REL_NO_ACTION, 0);
|
||||
d_assert(rv == CORE_OK, break, "s1ap send failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
d_warn("No PDN Connection in emm_state_attached");
|
||||
nas_send_service_reject(mme_ue, EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
nas_send_service_reject(mme_ue,
|
||||
EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK);
|
||||
FSM_TRAN(s, &emm_state_exception);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1297,6 +1297,9 @@ static void attach_test5(abts_case *tc, void *data)
|
|||
s1ap_message_t message;
|
||||
int i;
|
||||
int msgindex = 12;
|
||||
enb_ue_t *enb_ue = NULL;
|
||||
mme_ue_t *mme_ue = NULL;
|
||||
c_uint32_t m_tmsi = 0;
|
||||
|
||||
mongoc_collection_t *collection = NULL;
|
||||
bson_t *doc = NULL;
|
||||
|
|
@ -1490,9 +1493,16 @@ static void attach_test5(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Retreive M-TMSI */
|
||||
enb_ue = enb_ue_find_by_mme_ue_s1ap_id(2);
|
||||
d_assert(enb_ue, goto out,);
|
||||
mme_ue = enb_ue->mme_ue;
|
||||
d_assert(mme_ue, goto out,);
|
||||
m_tmsi = mme_ue->guti.m_tmsi;
|
||||
|
||||
/* Send Service request */
|
||||
rv = tests1ap_build_service_request(&sendbuf,
|
||||
0x40072e, 4, 0xda67, 0x12345678);
|
||||
0x40072e, 4, 0xda67, m_tmsi);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
|
@ -1517,6 +1527,7 @@ static void attach_test5(abts_case *tc, void *data)
|
|||
|
||||
core_sleep(time_from_msec(300));
|
||||
|
||||
out:
|
||||
/********** Remove Subscriber in Database */
|
||||
doc = BCON_NEW("imsi", BCON_UTF8("001010123456937"));
|
||||
ABTS_PTR_NOTNULL(tc, doc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue