Fixed ntohl bug in getting the service request m-tmsi.

master
Pedro Alvarez 7 years ago
parent 7ae2975de4
commit f4fba4e2f5

@ -517,7 +517,7 @@ s1ap::allocate_m_tmsi(uint64_t imsi)
{ {
uint32_t m_tmsi = m_next_m_tmsi++; uint32_t m_tmsi = m_next_m_tmsi++;
m_tmsi_to_imsi.insert(std::pair<uint32_t,uint64_t>(m_tmsi,imsi)); m_tmsi_to_imsi.insert(std::pair<uint32_t,uint64_t>(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; //uint32_t m_tmsi = 0x0123;
return m_tmsi; return m_tmsi;
} }

@ -124,9 +124,9 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
uint8_t buffer[4]; uint8_t buffer[4];
}LIBLTE_S1AP_M_TMSI_STRUCT;*/ }LIBLTE_S1AP_M_TMSI_STRUCT;*/
uint32_t *m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer; 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->info("Service request -- S-TMSI 0x%x\n ", ntohl(*m_tmsi));
m_s1ap_log->console("Service request -- S-TMSI 0x%x\n", *m_tmsi ); m_s1ap_log->console("Service request -- S-TMSI 0x%x\n", ntohl(*m_tmsi) );
handle_nas_service_request(*m_tmsi, nas_msg, reply_buffer,reply_flag, enb_sri); handle_nas_service_request(ntohl(*m_tmsi), nas_msg, reply_buffer,reply_flag, enb_sri);
return false; return false;
} }
m_pool->deallocate(nas_msg); m_pool->deallocate(nas_msg);
@ -584,8 +584,8 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi,
std::map<uint32_t,uint64_t>::iterator it = m_s1ap->m_tmsi_to_imsi.find(m_tmsi); std::map<uint32_t,uint64_t>::iterator it = m_s1ap->m_tmsi_to_imsi.find(m_tmsi);
if(it == m_s1ap->m_tmsi_to_imsi.end()) if(it == m_s1ap->m_tmsi_to_imsi.end())
{ {
m_s1ap_log->console("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\n"); m_s1ap_log->error("Could not find IMSI from M-TMSI. M-TMSI 0x%x\n", m_tmsi);
//FIXME send service reject //FIXME send service reject
return false; return false;
} }

Loading…
Cancel
Save