From d76053e7ec6a865e1f865dcce5227a8d61a2828b Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Mon, 13 Aug 2018 18:22:30 +0100 Subject: [PATCH] Making sure NAS message is added to the initial context setup request. --- srsepc/src/mme/nas.cc | 2 +- srsepc/src/mme/s1ap_ctx_mngmt_proc.cc | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/srsepc/src/mme/nas.cc b/srsepc/src/mme/nas.cc index 251d159a9..46d687fbe 100644 --- a/srsepc/src/mme/nas.cc +++ b/srsepc/src/mme/nas.cc @@ -786,7 +786,7 @@ nas::pack_attach_accept(srslte::byte_buffer_t *nas_buffer) ); memcpy(&nas_buffer->msg[1],mac,4); - m_nas_log->info("Packed Attach Complete\n"); + m_nas_log->info("Packed Attach Accept\n"); //Add nas message to context setup request //erab_ctxt->nAS_PDU_present = true; diff --git a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc index afbe19e3a..71e0ed4e6 100644 --- a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc @@ -155,7 +155,12 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas *nas_ctx, uint16_t e //Attach procedure initiated from an attach request m_s1ap_log->console("Adding attach accept to Initial Context Setup Request\n"); m_s1ap_log->info("Adding attach accept to Initial Context Setup Request\n"); - nas_ctx->pack_attach_accept(nas_buffer); + nas_ctx->pack_attach_accept(nas_buffer); + + //Add nas message to context setup request + erab_ctx_req->nAS_PDU_present = true; + memcpy(erab_ctx_req->nAS_PDU.buffer, nas_buffer->msg, nas_buffer->N_bytes); + erab_ctx_req->nAS_PDU.n_octets = nas_buffer->N_bytes; } srslte::byte_buffer_t *reply_buffer = m_pool->allocate();