Fixed bug in SPGW when replacing an existing eNB S1-U TEID. Service request seems to be working for the cases of ECM idle and ECM connected.

master
Pedro Alvarez 7 years ago
parent 0f45369d44
commit 50aeda2009

@ -667,22 +667,26 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi,
{ {
m_s1ap_log->error("Service Request -- User is ECM CONNECTED\n"); m_s1ap_log->error("Service Request -- User is ECM CONNECTED\n");
//Service request to Connected UE. //Release previous context
m_s1ap_log->info("Service Request -- Releasing previouse ECM context. eNB S1AP Id %d, MME UE S1AP Id %d\n", ecm_ctx->enb_ue_s1ap_id, ecm_ctx->mme_ue_s1ap_id);
m_s1ap->m_s1ap_ctx_mngmt_proc->send_ue_context_release_command(ecm_ctx,reply_buffer);
m_s1ap->release_ue_ecm_ctx(ecm_ctx->mme_ue_s1ap_id);
}
//Handle service request from Connected UE.
//Set eNB UE S1ap identity //Set eNB UE S1ap identity
ecm_ctx->enb_ue_s1ap_id = enb_ue_s1ap_id; // ecm_ctx->enb_ue_s1ap_id = enb_ue_s1ap_id;
m_s1ap_log->console("Service Request -- eNB UE S1AP Id %d \n", enb_ue_s1ap_id); // m_s1ap_log->console("Service Request -- eNB UE S1AP Id %d \n", enb_ue_s1ap_id);
m_s1ap_log->info("Service Request -- eNB UE S1AP Id %d\n ", enb_ue_s1ap_id); //m_s1ap_log->info("Service Request -- eNB UE S1AP Id %d\n ", enb_ue_s1ap_id);
//Delete eNB context and connect. //Delete eNB context and connect.
m_s1ap_log->console("Service Request -- User has ECM context already\n"); //m_s1ap_log->console("Service Request -- User has ECM context already\n");
m_s1ap_log->info("Service Request -- User has ECM context already\n"); //m_s1ap_log->info("Service Request -- User has ECM context already\n");
//m_s1ap->m_s1ap_ctx_mngmt_proc->send_ue_context_release_command(ecm_ctx,reply_buffer); //m_s1ap->m_s1ap_ctx_mngmt_proc->send_ue_context_release_command(ecm_ctx,reply_buffer);
//int default_bearer_id = 5; //int default_bearer_id = 5;
m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(emm_ctx, ecm_ctx, &ecm_ctx->erabs_ctx[5]); //m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(emm_ctx, ecm_ctx, &ecm_ctx->erabs_ctx[5]);
//FIXME Send Modify context request OR send ctx release command and wait for the reply. //}
} //else if(ecm_ctx->state == ECM_STATE_IDLE)
else if(ecm_ctx->state == ECM_STATE_IDLE) //{
{
ecm_ctx->enb_ue_s1ap_id = enb_ue_s1ap_id; ecm_ctx->enb_ue_s1ap_id = enb_ue_s1ap_id;
//UE not connect. Connect normally. //UE not connect. Connect normally.
@ -716,12 +720,12 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi,
//Save UE ctx to MME UE S1AP id //Save UE ctx to MME UE S1AP id
m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx); m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx);
m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(emm_ctx, ecm_ctx,&ecm_ctx->erabs_ctx[5]); m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(emm_ctx, ecm_ctx,&ecm_ctx->erabs_ctx[5]);
} /*}
else else
{ {
m_s1ap_log->console("ECM context is un-initialized.\n"); m_s1ap_log->console("ECM context is un-initialized.\n");
m_s1ap_log->error("ECM context is un-initialized.\n"); m_s1ap_log->error("ECM context is un-initialized.\n");
} }*/
} }
else else
{ {

@ -593,8 +593,10 @@ spgw::handle_modify_bearer_request(struct srslte::gtpc_pdu *mb_req_pdu, struct s
m_spgw_log->info("eNB Rx User TEID 0x%x, eNB Rx User IP %s\n", tunnel_ctx->dw_user_fteid.teid, inet_ntoa(addr3)); m_spgw_log->info("eNB Rx User TEID 0x%x, eNB Rx User IP %s\n", tunnel_ctx->dw_user_fteid.teid, inet_ntoa(addr3));
//Setup IP to F-TEID map //Setup IP to F-TEID map
//bool ret = false;
pthread_mutex_lock(&m_mutex); pthread_mutex_lock(&m_mutex);
m_ip_to_teid.insert(std::pair<uint32_t,srslte::gtpc_f_teid_ie>(tunnel_ctx->ue_ipv4, tunnel_ctx->dw_user_fteid)); m_ip_to_teid[tunnel_ctx->ue_ipv4]=tunnel_ctx->dw_user_fteid;
//ret = m_ip_to_teid.insert(std::pair<uint32_t,srslte::gtpc_f_teid_ie>(tunnel_ctx->ue_ipv4, tunnel_ctx->dw_user_fteid));
pthread_mutex_unlock(&m_mutex); pthread_mutex_unlock(&m_mutex);
//Setting up Modify bearer response PDU //Setting up Modify bearer response PDU

Loading…
Cancel
Save