[AMF/MME] fix the crash bug (#1061)

This commit is contained in:
Sukchan Lee 2021-06-22 16:13:06 +09:00
parent 00c96a3f0f
commit 50f403279a
6 changed files with 14 additions and 11 deletions

View File

@ -957,8 +957,7 @@ void gmm_state_initial_context_setup(ogs_fsm_t *s, amf_event_t *e)
ogs_assert(amf_ue->nas.message_type ==
OGS_NAS_5GS_REGISTRATION_REQUEST);
CLEAR_AMF_UE_TIMER(amf_ue->t3550);
ogs_assert(OGS_OK ==
nas_5gs_send_registration_accept(amf_ue));
ogs_assert(OGS_OK == nas_5gs_send_registration_accept(amf_ue));
if (!amf_ue->next.m_tmsi)
OGS_FSM_TRAN(s, &gmm_state_registered);

View File

@ -28,7 +28,7 @@ int nas_5gs_send_to_gnb(amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf)
ogs_assert(amf_ue);
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
ogs_assert(ran_ue);
ogs_expect_or_return_val(ran_ue, OGS_ERROR);
return ngap_send_to_ran_ue(ran_ue, pkbuf);
}
@ -71,7 +71,7 @@ int nas_5gs_send_registration_accept(amf_ue_t *amf_ue)
ogs_assert(amf_ue);
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
ogs_assert(ran_ue);
ogs_expect_or_return_val(ran_ue, OGS_ERROR);
ogs_debug("[%s] Registration accept", amf_ue->supi);
@ -173,7 +173,7 @@ int nas_5gs_send_service_accept(amf_ue_t *amf_ue)
ogs_assert(amf_ue);
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
ogs_assert(ran_ue);
ogs_expect_or_return_val(ran_ue, OGS_ERROR);
ogs_debug("[%s] Service accept", amf_ue->supi);
@ -254,7 +254,7 @@ int nas_5gs_send_de_registration_accept(amf_ue_t *amf_ue)
ogs_assert(amf_ue);
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
ogs_assert(ran_ue);
ogs_expect_or_return_val(ran_ue, OGS_ERROR);
ogs_debug("[%s] De-registration accept", amf_ue->supi);

View File

@ -1328,8 +1328,10 @@ void ngap_handle_ue_context_release_action(ran_ue_t *ran_ue)
ogs_info("UE Context Release [Action:%d]", ran_ue->ue_ctx_rel_action);
ogs_info(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]",
ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id);
if (amf_ue)
if (amf_ue) {
ogs_info(" SUCI[%s]", amf_ue->suci ? amf_ue->suci : "Unknown");
CLEAR_AMF_UE_ALL_TIMERS(amf_ue);
}
switch (ran_ue->ue_ctx_rel_action) {
case NGAP_UE_CTX_REL_NG_CONTEXT_REMOVE:

View File

@ -309,7 +309,7 @@ int ngap_send_ran_ue_context_release_command(
ogs_assert(ran_ue);
ogs_debug("UE Context release command");
ogs_debug("UEContextReleaseCommand");
ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]",
ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id);

View File

@ -32,7 +32,7 @@ int nas_eps_send_to_enb(mme_ue_t *mme_ue, ogs_pkbuf_t *pkbuf)
ogs_assert(mme_ue);
enb_ue = enb_ue_cycle(mme_ue->enb_ue);
ogs_assert(enb_ue);
ogs_expect_or_return_val(enb_ue, OGS_ERROR);
return s1ap_send_to_enb_ue(enb_ue, pkbuf);
}
@ -263,7 +263,7 @@ int nas_eps_send_detach_accept(mme_ue_t *mme_ue)
ogs_assert(mme_ue);
enb_ue = enb_ue_cycle(mme_ue->enb_ue);
ogs_assert(enb_ue);
ogs_expect_or_return_val(enb_ue, OGS_ERROR);
ogs_debug("[%s] Detach accept", mme_ue->imsi_bcd);

View File

@ -1377,8 +1377,10 @@ void s1ap_handle_ue_context_release_action(enb_ue_t *enb_ue)
ogs_info("UE Context Release [Action:%d]", enb_ue->ue_ctx_rel_action);
ogs_info(" ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]",
enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id);
if (mme_ue)
if (mme_ue) {
ogs_info(" IMSI[%s]", mme_ue->imsi_bcd);
CLEAR_MME_UE_ALL_TIMERS(mme_ue);
}
switch (enb_ue->ue_ctx_rel_action) {
case S1AP_UE_CTX_REL_S1_CONTEXT_REMOVE: