When initializing a new session, default to set the

"random" ISID randomly.

Dont assume that users will never create multiple contexts
concurrently, in which case the previous getpid()^time(NULL)
would create duplicates.
This commit is contained in:
Ronnie Sahlberg
2011-01-27 11:02:16 +11:00
parent ca1e152f2c
commit d22a2aee3c

View File

@@ -50,7 +50,7 @@ iscsi_create_context(const char *initiator_name)
iscsi->fd = -1;
/* initialize to a "random" isid */
iscsi_set_isid_random(iscsi, getpid() ^ time(NULL), 0);
iscsi_set_isid_random(iscsi, random(), 0);
/* assume we start in security negotiation phase */
iscsi->current_phase = ISCSI_PDU_LOGIN_CSG_SECNEG;