Commit d250abf3 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'fix_ngap_shutdown_issue' into 'develop'

Fix issue with SCTP shutdown (no UEs)

See merge request oai/cn5g/oai-cn5g-amf!19
parents 82ca64fe 7f07f1df
...@@ -417,21 +417,26 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) { ...@@ -417,21 +417,26 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) {
gc.get()->ng_state = NGAP_SHUTDOWN; gc.get()->ng_state = NGAP_SHUTDOWN;
// Release all the resources related to this interface // Release all the resources related to this interface
uint32_t ran_ue_ngap_id = 0;
for (auto ue_context : ranid2uecontext) { for (auto ue_context : ranid2uecontext) {
if (ue_context.second->gnb_assoc_id == itti_msg.assoc_id) { if (ue_context.second->gnb_assoc_id == itti_msg.assoc_id) {
uint32_t ran_ue_ngap_id = ue_context.second->ran_ue_ngap_id; ran_ue_ngap_id = ue_context.second->ran_ue_ngap_id;
long amf_ue_ngap_id = ue_context.second->amf_ue_ngap_id; long amf_ue_ngap_id = ue_context.second->amf_ue_ngap_id;
// get NAS context // get NAS context
std::shared_ptr<nas_context> nc; std::shared_ptr<nas_context> nc;
if (amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id)) if (amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id)) {
nc = amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id); nc = amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id);
else { stacs.update_5gmm_state(nc.get()->imsi, "5GMM-DEREGISTERED");
} else {
Logger::amf_n2().warn( Logger::amf_n2().warn(
"No existed nas_context with amf_ue_ngap_id(0x%x)", amf_ue_ngap_id); "No existed nas_context with amf_ue_ngap_id(0x%x)", amf_ue_ngap_id);
} }
stacs.update_5gmm_state(nc.get()->imsi, "5GMM-DEREGISTERED");
} }
} }
// remove UE context
if (ranid2uecontext.count(ran_ue_ngap_id) > 0) {
ranid2uecontext.erase(ran_ue_ngap_id);
}
// Delete gNB context // Delete gNB context
remove_gnb_context(itti_msg.assoc_id); remove_gnb_context(itti_msg.assoc_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment