INIT call srand() once at iscsi_create_context()

currently the rng is not seeded at all which makes the isid not really random
at all.
This commit is contained in:
Peter Lieven
2012-11-06 15:01:34 +01:00
parent 6cad82532a
commit f00cd04810
2 changed files with 3 additions and 0 deletions

View File

@@ -88,6 +88,8 @@ iscsi_create_context(const char *initiator_name)
iscsi->fd = -1;
srand(time(NULL) ^ getpid() ^ (u_int32_t) iscsi);
/* initialize to a "random" isid */
iscsi_set_isid_random(iscsi, rand(), 0);