Remove unecessary context lookup in increment_ue_sqn

master
Pedro Alvarez 5 years ago
parent 4f62e6c08c
commit 93fbf741d7

@ -101,7 +101,7 @@ private:
std::vector<std::string> split_string(const std::string& str, char delimiter); std::vector<std::string> split_string(const std::string& str, char delimiter);
void get_uint_vec_from_hex_str(const std::string& key_str, uint8_t* key, uint len); void get_uint_vec_from_hex_str(const std::string& key_str, uint8_t* key, uint len);
void increment_ue_sqn(uint64_t imsi); void increment_ue_sqn(hss_ue_ctx_t* ue_ctx);
void increment_seq_after_resync(uint64_t imsi); void increment_seq_after_resync(uint64_t imsi);
void increment_sqn(uint8_t* sqn, uint8_t* next_sqn); void increment_sqn(uint8_t* sqn, uint8_t* next_sqn);
void set_sqn(uint64_t imsi, uint8_t* sqn); void set_sqn(uint64_t imsi, uint8_t* sqn);

@ -272,7 +272,7 @@ bool hss::gen_auth_info_answer(uint64_t imsi, uint8_t* k_asme, uint8_t* autn, ui
gen_auth_info_answer_milenage(ue_ctx, k_asme, autn, rand, xres); gen_auth_info_answer_milenage(ue_ctx, k_asme, autn, rand, xres);
break; break;
} }
increment_ue_sqn(imsi); increment_ue_sqn(ue_ctx);
return true; return true;
} }
@ -546,15 +546,10 @@ bool hss::resync_sqn_milenage(uint64_t imsi, uint8_t* auts)
return true; return true;
} }
void hss::increment_ue_sqn(uint64_t imsi) void hss::increment_ue_sqn(hss_ue_ctx_t* ue_ctx)
{ {
hss_ue_ctx_t* ue_ctx = get_ue_ctx(imsi);
if (ue_ctx == nullptr) {
return;
}
increment_sqn(ue_ctx->sqn, ue_ctx->sqn); increment_sqn(ue_ctx->sqn, ue_ctx->sqn);
m_hss_log->debug("Incremented SQN -- IMSI: %015" PRIu64 "\n", imsi); m_hss_log->debug("Incremented SQN -- IMSI: %015" PRIu64 "\n", ue_ctx->imsi);
m_hss_log->debug_hex(ue_ctx->sqn, 6, "SQN: "); m_hss_log->debug_hex(ue_ctx->sqn, 6, "SQN: ");
} }

Loading…
Cancel
Save