Commit a3f7ac79 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix Mobility Registration Update

parent 4c543016
......@@ -3373,19 +3373,28 @@ void amf_n1::sha256(
void amf_n1::run_mobility_registration_update_procedure(
std::shared_ptr<nas_context>& nc, uint16_t uplink_data_status,
uint16_t pdu_session_status) {
std::shared_ptr<ue_context> uc = {};
if (!find_ue_context(nc, uc)) {
Logger::amf_n1().warn("Cannot find the UE context");
return;
}
nas_secu_ctx* secu = nc->security_ctx;
if (!secu) {
Logger::amf_n1().warn("No Security Context found");
// Run Registration procedure
run_registration_procedure(nc);
return;
}
std::shared_ptr<pdu_session_context> psc = {};
// Encoding REGISTRATION ACCEPT
auto reg_accept = std::make_unique<RegistrationAccept>();
initialize_registration_accept(reg_accept);
reg_accept->Set5gsNetworkFeatureSupport(
0x00, 0x00); // TODO: remove hardcoded values
std::shared_ptr<pdu_session_context> psc = {};
std::shared_ptr<ue_context> uc = {};
if (!find_ue_context(nc, uc)) {
Logger::amf_n1().warn("Cannot find the UE context");
return;
}
reg_accept->Set5gGuti(
amf_cfg.guami.mcc, amf_cfg.guami.mnc, amf_cfg.guami.regionID,
amf_cfg.guami.AmfSetID, amf_cfg.guami.AmfPointer, uc->tmsi);
......@@ -3399,12 +3408,6 @@ void amf_n1::run_mobility_registration_update_procedure(
return;
}
nas_secu_ctx* secu = nc->security_ctx;
if (!secu) {
Logger::amf_n1().error("No Security Context found");
return;
}
// protect nas message
bstring protected_nas = nullptr;
encode_nas_message_protected(
......
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