Commit 74b48ea3 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue for PDU session release without context

parent a3f7ac79
......@@ -730,6 +730,12 @@ void amf_n1::identity_response_handle(
if (uc != nullptr) {
uc->supi = "imsi-" + supi;
// associate SUPI with UC
// Verify if there's PDU session info in the old context
if (amf_app_inst->is_supi_2_ue_context(supi)) {
std::shared_ptr<ue_context> old_uc = {};
old_uc = amf_app_inst->supi_2_ue_context(supi);
uc->copy_pdu_sessions(old_uc);
}
amf_app_inst->set_supi_2_ue_context(uc->supi, uc);
Logger::amf_n1().debug("Update UC context, SUPI %s", uc->supi.c_str());
}
......
......@@ -101,7 +101,8 @@ int UENetworkCapability::Encode(uint8_t* buf, int len) {
// TODO: Encode the rest as spare for now
uint8_t spare = 0;
for (int i = 0; i < (ie_len - encoded_size); i++) {
int spare_len = ie_len - encoded_size;
for (int i = 0; i < spare_len; i++) {
ENCODE_U8(buf + encoded_size, spare, encoded_size);
}
......@@ -136,7 +137,8 @@ int UENetworkCapability::Decode(uint8_t* buf, int len, bool is_iei) {
// TODO: decode the rest as spare for now
uint8_t spare = 0;
for (int i = 0; i < (ie_len - decoded_size); i++) {
int spare_len = ie_len - decoded_size;
for (int i = 0; i < spare_len; i++) {
ENCODE_U8(buf + decoded_size, spare, decoded_size);
}
......
......@@ -227,7 +227,8 @@ int UESecurityCapability::Decode(uint8_t* buf, int len, bool is_iei) {
// TODO: decode the rest as spare for now
uint8_t spare = 0;
for (int i = 0; i < (ie_len - decoded_size); i++) {
int spare_len = ie_len - decoded_size;
for (int i = 0; i < spare_len; i++) {
DECODE_U8(buf + decoded_size, spare, decoded_size);
}
......
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