Commit 723e272e authored by Laurent THOMAS's avatar Laurent THOMAS

fix 4G ue release context cleaning

parent 88a63e35
......@@ -538,7 +538,7 @@ init_MCCH(
RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[sync_area] = do_MBSFNAreaConfig(enb_mod_idP,
sync_area,
(uint8_t *)RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE[sync_area],
100, /* TODO: what is the actual size of .MCCH_MESSAGE[sync_area]? */
32, /* TODO: what is the actual size of .MCCH_MESSAGE[sync_area]? */
&RC.rrc[enb_mod_idP]->carrier[CC_id].mcch,
&RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message);
LOG_I(RRC, "mcch message pointer %p for sync area %d \n",
......@@ -1225,7 +1225,7 @@ rrc_eNB_generate_SecurityModeCommand(
)
//-----------------------------------------------------------------------------
{
uint8_t buffer[100];
uint8_t buffer[100]={0};
uint8_t size;
T(T_ENB_RRC_SECURITY_MODE_COMMAND, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
......@@ -2201,10 +2201,9 @@ rrc_eNB_generate_RRCConnectionRelease(
)
//-----------------------------------------------------------------------------
{
uint8_t buffer[RRC_BUF_SIZE];
uint8_t buffer[RRC_BUF_SIZE]={0};
uint16_t size = 0;
int release_num;
memset(buffer, 0, sizeof(buffer));
T(T_ENB_RRC_CONNECTION_RELEASE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
#if 0
......@@ -4993,19 +4992,17 @@ void rrc_eNB_handover_ue_context_release(
struct rrc_eNB_ue_context_s *ue_context_p) {
int e_rab = 0;
//MessageDef *msg_release_p = NULL;
MessageDef *msg_delete_tunnels_p = NULL;
uint32_t eNB_ue_s1ap_id = ue_context_p->ue_context.eNB_ue_s1ap_id;
//msg_release_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE);
//itti_send_msg_to_task(TASK_S1AP, ctxt_pP->module_id, msg_release_p);
s1ap_ue_context_release(ctxt_pP->instance, ue_context_p->ue_context.eNB_ue_s1ap_id);
//MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id);
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, 0, GTPV1U_ENB_DELETE_TUNNEL_REQ);
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).from_gnb = 0;
gtpv1u_enb_delete_tunnel_req_t delete_tunnels={0};
delete_tunnels.rnti = ue_context_p->ue_context.rnti;
delete_tunnels.from_gnb = 0;
for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] =
delete_tunnels.eps_bearer_id[delete_tunnels.num_erab++] =
ue_context_p->ue_context.enb_gtp_ebi[e_rab];
// erase data
ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
......@@ -5013,7 +5010,7 @@ void rrc_eNB_handover_ue_context_release(
ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0;
}
itti_send_msg_to_task(TASK_VARIABLE, ctxt_pP->module_id, msg_delete_tunnels_p);
gtpv1u_delete_s1u_tunnel(ctxt_pP->module_id, &delete_tunnels);
struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = NULL;
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(RC.rrc[ctxt_pP->module_id], 0, eNB_ue_s1ap_id);
......@@ -5166,7 +5163,7 @@ check_handovers(
msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_HANDOVER_REQ_ACK);
rrc_eNB_generate_HO_RRCConnectionReconfiguration(ctxt_pP, ue_context_p,
X2AP_HANDOVER_REQ_ACK(msg).rrc_buffer,
RRC_BUF_SIZE, // TODO: supposed to be size of the .rrc_buffer. Is this right?
sizeof(X2AP_HANDOVER_REQ_ACK(msg).rrc_buffer),
&X2AP_HANDOVER_REQ_ACK(msg).rrc_buffer_size);
rrc_eNB_configure_rbs_handover(ue_context_p,ctxt_pP);
X2AP_HANDOVER_REQ_ACK(msg).rnti = ue_context_p->ue_context.rnti;
......@@ -7869,7 +7866,6 @@ rrc_eNB_decode_dcch(
LTE_UL_DCCH_Message_t *ul_dcch_msg = NULL; //&uldcchmsg;
int i;
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
MessageDef *msg_delete_tunnels_p = NULL;
uint8_t xid;
int dedicated_DRB=0;
T(T_ENB_RRC_UL_DCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
......@@ -8107,21 +8103,19 @@ rrc_eNB_decode_dcch(
xid = ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier;
ue_context_p->ue_context.e_rab_release_command_flag = 0;
//gtp tunnel delete
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, 0, GTPV1U_ENB_DELETE_TUNNEL_REQ);
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).from_gnb = 0;
gtpv1u_enb_delete_tunnel_req_t delete_tunnels={0};
delete_tunnels.rnti = ue_context_p->ue_context.rnti;
delete_tunnels.from_gnb = 0;
for(i = 0; i < NB_RB_MAX; i++) {
if(xid == ue_context_p->ue_context.e_rab[i].xid) {
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
delete_tunnels.eps_bearer_id[delete_tunnels.num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
ue_context_p->ue_context.enb_gtp_teid[i] = 0;
memset(&ue_context_p->ue_context.enb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[i]));
ue_context_p->ue_context.enb_gtp_ebi[i] = 0;
}
}
itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->instance, msg_delete_tunnels_p);
gtpv1u_delete_s1u_tunnel(ctxt_pP->instance, &delete_tunnels);
//S1AP_E_RAB_RELEASE_RESPONSE
rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(ctxt_pP,
ue_context_p,
......
......@@ -261,23 +261,33 @@ boolean_t gtpv_data_req_new (
void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
module_id_t enb_mod_idP,
const rrc_eNB_ue_context_t* const ue_context_pP
rrc_eNB_ue_context_t* ue_context_pP
)
{
if (!ue_context_pP) {
LOG_W(RRC, "[eNB] In %s: invalid UE\n", __func__);
return;
}
eNB_RRC_UE_t *ue = &ue_context_pP->ue_context;
gtpv1u_enb_delete_tunnel_req_t tmp={0};
tmp.rnti = ue_context_pP->ue_context.rnti;
tmp.rnti = ue->rnti;
tmp.from_gnb = 0;
tmp.num_erab = ue_context_pP->ue_context.nb_of_e_rabs;
for (int e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_e_rabs; e_rab++) {
const rb_id_t gtp_ebi = ue_context_pP->ue_context.enb_gtp_ebi[e_rab];
tmp.num_erab = ue->nb_of_e_rabs;
for (int e_rab = 0; e_rab < ue->nb_of_e_rabs; e_rab++) {
const rb_id_t gtp_ebi = ue->enb_gtp_ebi[e_rab];
tmp.eps_bearer_id[e_rab] = gtp_ebi;
}
gtpv1u_delete_s1u_tunnel(enb_mod_idP,&tmp);
gtpv1u_delete_s1u_tunnel(enb_mod_idP,&tmp);
if ( ue->ue_release_timer_rrc > 0
&& (ue->handover_info == NULL ||
(ue->handover_info->state != HO_RELEASE &&
ue->handover_info->state != HO_CANCEL
)
)
)
ue->ue_release_timer_rrc = ue->ue_release_timer_thres_rrc;
}
......@@ -57,7 +57,7 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
*/
void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
module_id_t enb_mod_idP,
const rrc_eNB_ue_context_t* const ue_context_pP
rrc_eNB_ue_context_t* ue_context_pP
);
boolean_t
......
......@@ -1695,7 +1695,6 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms
uint8_t b_existed,is_existed;
uint8_t xid;
uint8_t e_rab_release_drb;
MessageDef *msg_delete_tunnels_p = NULL;
e_rab_release_drb = 0;
memcpy(&e_rab_release_params[0], &(S1AP_E_RAB_RELEASE_COMMAND (msg_p).e_rab_release_params[0]), sizeof(e_rab_release_t)*S1AP_MAX_E_RAB);
eNB_ue_s1ap_id = S1AP_E_RAB_RELEASE_COMMAND (msg_p).eNB_ue_s1ap_id;
......@@ -1763,21 +1762,19 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release(&ctxt, ue_context_p, xid, S1AP_E_RAB_RELEASE_COMMAND (msg_p).nas_pdu.length, S1AP_E_RAB_RELEASE_COMMAND (msg_p).nas_pdu.buffer);
} else {
//gtp tunnel delete
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, 0, GTPV1U_ENB_DELETE_TUNNEL_REQ);
memset(&GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).from_gnb = 0;
gtpv1u_enb_delete_tunnel_req_t delete_tunnels={0};
delete_tunnels.rnti = ue_context_p->ue_context.rnti;
delete_tunnels.from_gnb = 0;
for(i = 0; i < NB_RB_MAX; i++) {
if(xid == ue_context_p->ue_context.e_rab[i].xid) {
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
delete_tunnels.eps_bearer_id[delete_tunnels.num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
ue_context_p->ue_context.enb_gtp_teid[i] = 0;
memset(&ue_context_p->ue_context.enb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[i]));
ue_context_p->ue_context.enb_gtp_ebi[i] = 0;
}
}
itti_send_msg_to_task(TASK_VARIABLE, instance, msg_delete_tunnels_p);
gtpv1u_delete_s1u_tunnel(instance,&delete_tunnels);
//S1AP_E_RAB_RELEASE_RESPONSE
rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(&ctxt, ue_context_p, xid);
}
......@@ -2242,8 +2239,16 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p,
&delete_tunnel_req);
/* TBD: release the DRB not admitted */
//rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(&ctxt, ue_context_p, 0);
}
if ( ue_context_p->ue_context.ue_release_timer_rrc > 0 &&
(ue_context_p->ue_context.handover_info == NULL ||
(ue_context_p->ue_context.handover_info->state != HO_RELEASE &&
ue_context_p->ue_context.handover_info->state != HO_CANCEL
)
)
)
ue_context_p->ue_context.ue_release_timer_rrc = ue_context_p->ue_context.ue_release_timer_thres_rrc;
}
/* Security key */
ue_context_p->ue_context.next_hop_chain_count=S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_hop_chain_count;
memcpy ( ue_context_p->ue_context.next_security_key,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment