From 9b28527423df2267411f13af9ca6dd2747292c88 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 8 Mar 2018 17:59:03 +0000 Subject: [PATCH] Fixed bug in release access bearers request --- srsepc/src/mme/mme_gtpc.cc | 16 +++++++++++++--- srsepc/src/mme/s1ap.cc | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/srsepc/src/mme/mme_gtpc.cc b/srsepc/src/mme/mme_gtpc.cc index 799bd8bfd..a4b3bbbe3 100644 --- a/srsepc/src/mme/mme_gtpc.cc +++ b/srsepc/src/mme/mme_gtpc.cc @@ -351,15 +351,25 @@ mme_gtpc::send_release_access_bearers_request(uint64_t imsi) { m_mme_gtpc_log->info("Sending GTP-C Delete Access Bearers Request\n"); srslte::gtpc_pdu rel_req_pdu; - srslte::gtpc_f_teid_ie *sgw_ctrl_fteid = NULL; + srslte::gtp_fteid_t sgw_ctr_fteid; + + //Get S-GW Ctr TEID + std::map::iterator it_ctx = m_imsi_to_gtpc_ctx.find(imsi); + if(it_ctx == m_imsi_to_gtpc_ctx.end()) + { + m_mme_gtpc_log->error("Could not find GTP-C context to remove\n"); + return; + } + sgw_ctr_fteid = it_ctx->second.sgw_ctr_fteid; + //Set GTP-C header srslte::gtpc_header *header = &rel_req_pdu.header; header->teid_present = true; - header->teid = sgw_ctrl_fteid->teid; + header->teid = sgw_ctr_fteid.teid; header->type = srslte::GTPC_MSG_TYPE_RELEASE_ACCESS_BEARERS_REQUEST; srslte::gtpc_release_access_bearers_request *rel_req = &rel_req_pdu.choice.release_access_bearers_request; - m_mme_gtpc_log->info("GTP-C Release Access Berarers Request -- S-GW Control TEID %d\n", sgw_ctrl_fteid->teid ); + m_mme_gtpc_log->info("GTP-C Release Access Berarers Request -- S-GW Control TEID %d\n", sgw_ctr_fteid.teid ); srslte::gtpc_pdu rel_resp_pdu; m_spgw->handle_release_access_bearers_request(&rel_req_pdu, &rel_resp_pdu); diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 19b32ba24..9d3c9e042 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -526,6 +526,7 @@ s1ap::activate_eps_bearer(uint64_t imsi, uint8_t ebi) } ecm_ctx->erabs_ctx[ebi].state = ERAB_ACTIVE; + ecm_ctx->state = ECM_STATE_CONNECTED; m_s1ap_log->info("Activated EPS Bearer\n"); return; }