-Initialize enb_ue_s1ap_id to invalid value

-Use mme_ue_s1apid if enb_ue_s1ap_id is not valid when encoding
ue_context_release_command
This commit is contained in:
James Park 2018-04-17 14:35:15 -07:00
parent 553804dd94
commit c968067829
3 changed files with 17 additions and 12 deletions

View File

@ -1761,6 +1761,7 @@ enb_ue_t* enb_ue_add(mme_enb_t *enb)
index_alloc(&enb_ue_pool, &enb_ue);
d_assert(enb_ue, return NULL, "Null param");
enb_ue->enb_ue_s1ap_id = INVALID_UE_S1AP_ID;
enb_ue->mme_ue_s1ap_id = NEXT_ID(self.mme_ue_s1ap_id, 1, 0xffffffff);
enb_ue->enb = enb;

View File

@ -160,6 +160,7 @@ struct _enb_ue_t {
index_t index; /* An index of this node */
/* UE identity */
#define INVALID_UE_S1AP_ID 0xffffffff /* Initial value of enb_ue_s1ap_id */
c_uint32_t enb_ue_s1ap_id; /* eNB-UE-S1AP-ID received from eNB */
c_uint32_t mme_ue_s1ap_id; /* MME-UE-S1AP-ID received from MME */

View File

@ -1029,18 +1029,21 @@ status_t s1ap_build_ue_context_release_command(
Cause = &ie->value.choice.Cause;
#if UE_S1AP_IDs_PRESENT_mME_UE_S1AP_ID
UE_S1AP_IDs->present = S1AP_UE_S1AP_IDs_PR_mME_UE_S1AP_ID;
UE_S1AP_IDs->choice.mME_UE_S1AP_ID = enb_ue->mme_ue_s1ap_id;
#else
UE_S1AP_IDs->present = S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair;
UE_S1AP_IDs->choice.uE_S1AP_ID_pair =
core_calloc(1, sizeof(S1AP_UE_S1AP_ID_pair_t));
UE_S1AP_IDs->choice.uE_S1AP_ID_pair->mME_UE_S1AP_ID =
enb_ue->mme_ue_s1ap_id;
UE_S1AP_IDs->choice.uE_S1AP_ID_pair->eNB_UE_S1AP_ID =
enb_ue->enb_ue_s1ap_id;
#endif
if (enb_ue->enb_ue_s1ap_id == INVALID_UE_S1AP_ID)
{
UE_S1AP_IDs->present = S1AP_UE_S1AP_IDs_PR_mME_UE_S1AP_ID;
UE_S1AP_IDs->choice.mME_UE_S1AP_ID = enb_ue->mme_ue_s1ap_id;
}
else
{
UE_S1AP_IDs->present = S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair;
UE_S1AP_IDs->choice.uE_S1AP_ID_pair =
core_calloc(1, sizeof(S1AP_UE_S1AP_ID_pair_t));
UE_S1AP_IDs->choice.uE_S1AP_ID_pair->mME_UE_S1AP_ID =
enb_ue->mme_ue_s1ap_id;
UE_S1AP_IDs->choice.uE_S1AP_ID_pair->eNB_UE_S1AP_ID =
enb_ue->enb_ue_s1ap_id;
}
Cause->present = group;
Cause->choice.radioNetwork = cause;