Browse Source

[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>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
5f4ab0d22a
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/tcp/iscsi.c

+ 1
- 1
src/net/tcp/iscsi.c View File

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

Loading…
Cancel
Save