From 19c59bb1317e58c44ce606dadbd0ee8dcfcf19ac Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 18 Oct 2010 14:37:11 +0100 Subject: [iscsi] Ensure ISID is consistent within an iSCSI session Commit 5f4ab0d ("[iscsi] Randomise a portion of the ISID to force new session instantiation") introduced a regression by randomising the ISID on each call to iscsi_start_login(), which may be called more than once per connection, rather than on each call to iscsi_open_connection(), which is guaranteed to be called only once per connection. This is incorrect behaviour that causes our connection to be rejected by some iSCSI targets (observed with a COMSTAR target under OpenSolaris). Fix by generating the ISID in iscsi_open_connection(), and storing the randomised ISID as part of the session state. Signed-off-by: Michael Brown --- src/include/ipxe/iscsi.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/iscsi.h b/src/include/ipxe/iscsi.h index e711459c9..4890bcc6d 100644 --- a/src/include/ipxe/iscsi.h +++ b/src/include/ipxe/iscsi.h @@ -539,6 +539,12 @@ struct iscsi_session { /** CHAP response (used for both initiator and target auth) */ struct chap_response chap; + /** Initiator session ID (IANA format) qualifier + * + * This is part of the ISID. It is generated randomly + * whenever a new connection is opened. + */ + uint16_t isid_iana_qual; /** Initiator task tag * * This is the tag of the current command. It is incremented -- cgit v1.2.3-55-g7522