Commit eb8c54b8 authored by Niuhaiwen's avatar Niuhaiwen

fix bug:handover from ncc=7 to ncc=0

parent def06a5a
...@@ -869,9 +869,17 @@ void amf_n2::handle_itti_message( ...@@ -869,9 +869,17 @@ void amf_n2::handle_itti_message(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void amf_n2::handle_itti_message(itti_handover_required& itti_msg) { void amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
int handover_num_8 = 0;
ncc++; ncc++;
if(ncc > 7) if(ncc > 7)
ncc = 0; {
ncc = 0;
handover_num_8 = handover_num_8 + 1;
}
//if(ncc == 1)
//{
//ncc++;
//}
unsigned long amf_ue_ngap_id = itti_msg.handvoerRequ->getAmfUeNgapId(); unsigned long amf_ue_ngap_id = itti_msg.handvoerRequ->getAmfUeNgapId();
uint32_t ran_ue_ngap_id = itti_msg.handvoerRequ->getRanUeNgapId(); uint32_t ran_ue_ngap_id = itti_msg.handvoerRequ->getRanUeNgapId();
std::shared_ptr<gnb_context> gc; std::shared_ptr<gnb_context> gc;
...@@ -1000,7 +1008,7 @@ void amf_n2::handle_itti_message(itti_handover_required& itti_msg) { ...@@ -1000,7 +1008,7 @@ void amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
Logger::amf_n1().debug("uplink count(%d)", amf_n2_ulcount); Logger::amf_n1().debug("uplink count(%d)", amf_n2_ulcount);
uint8_t knh[32]; uint8_t knh[32];
Authentication_5gaka::handover_ncc_derive_knh( Authentication_5gaka::handover_ncc_derive_knh(
amf_n2_ulcount, 0x01, kamf, kgnb, knh, ncc); amf_n2_ulcount, 0x01, kamf, kgnb, knh, ncc + 8*handover_num_8);
bstring knh_bs = blk2bstr(knh, 32); bstring knh_bs = blk2bstr(knh, 32);
handoverrequest->setSecurityContext( handoverrequest->setSecurityContext(
ncc /*NCC count*/, (uint8_t*) bdata(knh_bs)); ncc /*NCC count*/, (uint8_t*) bdata(knh_bs));
......
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