use time in usec for rand seed

removed extra call to srand in sesue process
This commit is contained in:
Joseph Giovatto 2019-06-12 12:39:59 -04:00 committed by Andre Puschmann
parent 4a0ebe0cca
commit 69e9066c76
2 changed files with 7 additions and 5 deletions

View File

@ -170,8 +170,13 @@ void rrc::init(phy_interface_rrc_lte* phy_,
set_mac_default();
measurements.init(this);
// set seed for rand (used in attach)
srand(time(NULL));
struct timeval tv;
gettimeofday(&tv, NULL);
rrc_log->info("using srand seed of %ld\n", tv.tv_usec);
// set seed (used in CHAP auth and attach)
srand(tv.tv_usec);
running = true;
start();

View File

@ -119,9 +119,6 @@ void nas::init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_
have_ctxt = true;
}
// set seed for rand (used in CHAP auth)
srand(time(NULL));
running = true;
}