2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-26 11:19:17 +00:00

[iscsi] Randomise a portion of the ISID to force new session instantiation

When a connection to an iSCSI target is broken without gracefully
closing the TCP socket, a subsequent connection attempt may fail
because the target believes that we are attempting session
reinstatement (see RFC3720 section 5.3.1).  This has been observed
using the Microsoft iSCSI target.

Section 9.1.1 of RFC3720 states that initiators should use a stable
ISID, however section 5.3.1 shows that the only way to explicitly
request that a new session be created is to use a new ISID.

Fix by randomising the "qualifier" portion of the ISID.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2010-10-16 22:11:08 +01:00
parent 60b690141e
commit 5f4ab0d22a

View File

@ -707,7 +707,7 @@ static void iscsi_start_login ( struct iscsi_session *iscsi ) {
ISCSI_SET_LENGTHS ( request->lengths, 0, len );
request->isid_iana_en = htonl ( ISCSI_ISID_IANA |
IANA_EN_FEN_SYSTEMS );
/* isid_iana_qual left as zero */
request->isid_iana_qual = ( random() & 0xffff );
/* tsih left as zero */
request->itt = htonl ( iscsi->itt );
/* cid left as zero */