From acf098be92be9ff75a010d61768f8e47c34a8ab9 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 30 Apr 2021 13:51:08 +0200 Subject: [PATCH] epc,s1ap: remove use of rand() --- srsepc/src/mme/s1ap.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index ef4725e4a..866202a5f 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -16,6 +16,7 @@ #include "srsran/common/liblte_security.h" #include #include // for printing uint64_t +#include namespace srsepc { @@ -53,7 +54,11 @@ int s1ap::init(const s1ap_args_t& s1ap_args) { m_s1ap_args = s1ap_args; srsran::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn); - m_next_m_tmsi = rand(); + + std::random_device rd; + std::mt19937 generator(rd()); + std::uniform_int_distribution distr(0, std::numeric_limits::max()); + m_next_m_tmsi = distr(generator); // Get pointer to the HSS m_hss = hss::get_instance();