From f4fba4e2f5062d2e0075546649636d9b2d9f13df Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 15 Feb 2018 11:58:46 +0000 Subject: [PATCH] Fixed ntohl bug in getting the service request m-tmsi. --- srsepc/src/mme/s1ap.cc | 2 +- srsepc/src/mme/s1ap_nas_transport.cc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 31db87cf5..f72eb9bc4 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -517,7 +517,7 @@ s1ap::allocate_m_tmsi(uint64_t imsi) { uint32_t m_tmsi = m_next_m_tmsi++; m_tmsi_to_imsi.insert(std::pair(m_tmsi,imsi)); - m_s1ap_log->info("Allocated M-TMSI 0x%x,\n",m_tmsi); + m_s1ap_log->debug("Allocated M-TMSI 0x%x to IMSI %015ul,\n",m_tmsi,imsi); //uint32_t m_tmsi = 0x0123; return m_tmsi; } diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index 3377dd755..a40461064 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -124,9 +124,9 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA uint8_t buffer[4]; }LIBLTE_S1AP_M_TMSI_STRUCT;*/ uint32_t *m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer; - m_s1ap_log->info("Service request -- S-TMSI 0x%x\n ", *m_tmsi); - m_s1ap_log->console("Service request -- S-TMSI 0x%x\n", *m_tmsi ); - handle_nas_service_request(*m_tmsi, nas_msg, reply_buffer,reply_flag, enb_sri); + m_s1ap_log->info("Service request -- S-TMSI 0x%x\n ", ntohl(*m_tmsi)); + m_s1ap_log->console("Service request -- S-TMSI 0x%x\n", ntohl(*m_tmsi) ); + handle_nas_service_request(ntohl(*m_tmsi), nas_msg, reply_buffer,reply_flag, enb_sri); return false; } m_pool->deallocate(nas_msg); @@ -584,8 +584,8 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi, std::map::iterator it = m_s1ap->m_tmsi_to_imsi.find(m_tmsi); if(it == m_s1ap->m_tmsi_to_imsi.end()) { - m_s1ap_log->console("Could not find IMSI from M-TMSI\n"); - m_s1ap_log->error("Could not find IMSI from M-TMSI\n"); + m_s1ap_log->console("Could not find IMSI from M-TMSI. M-TMSI 0x%x\n", m_tmsi); + m_s1ap_log->error("Could not find IMSI from M-TMSI. M-TMSI 0x%x\n", m_tmsi); //FIXME send service reject return false; }