From 711df439dfdc4abf88d335bc11d39adbf2bf67d4 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 24 Feb 2011 13:22:20 +0000 Subject: [iscsi] Accept NOP-In PDUs sent by the target Some iSCSI targets (observed with a Synology DS207+ NAS) send unsolicited NOP-Ins to the initiator. RFC 3720 is remarkably unclear and possibly self-contradictory on how NOPs are supposed to work, but it seems as though we can legitimately just ignore any unsolicited NOP-In PDU. Reported-by: Marc Lecuyer Originally-implemented-by: Thomas Miletich Signed-off-by: Michael Brown --- src/include/ipxe/iscsi.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/iscsi.h b/src/include/ipxe/iscsi.h index f336c7cc0..2202a9d87 100644 --- a/src/include/ipxe/iscsi.h +++ b/src/include/ipxe/iscsi.h @@ -93,6 +93,9 @@ struct iscsi_bhs_common { /** iSCSI tag magic marker */ #define ISCSI_TAG_MAGIC 0x18ae0000 +/** iSCSI reserved tag value */ +#define ISCSI_TAG_RESERVED 0xffffffff + /** * iSCSI basic header segment common request fields * @@ -455,6 +458,36 @@ struct iscsi_bhs_r2t { /** R2T opcode */ #define ISCSI_OPCODE_R2T 0x31 +/** + * iSCSI NOP-In basic header segment + * + */ +struct iscsi_nop_in { + /** Opcode */ + uint8_t opcode; + /** Reserved */ + uint8_t reserved_a[3]; + /** Segment lengths */ + union iscsi_segment_lengths lengths; + /** Logical Unit Number */ + struct scsi_lun lun; + /** Initiator Task Tag */ + uint32_t itt; + /** Target Transfer Tag */ + uint32_t ttt; + /** Status sequence number */ + uint32_t statsn; + /** Expected command sequence number */ + uint32_t expcmdsn; + /** Maximum command sequence number */ + uint32_t maxcmdsn; + /** Reserved */ + uint8_t reserved_b[12]; +}; + +/** NOP-In opcode */ +#define ISCSI_OPCODE_NOP_IN 0x20 + /** * An iSCSI basic header segment */ @@ -468,6 +501,7 @@ union iscsi_bhs { struct iscsi_bhs_data_in data_in; struct iscsi_bhs_data_out data_out; struct iscsi_bhs_r2t r2t; + struct iscsi_nop_in nop_in; unsigned char bytes[ sizeof ( struct iscsi_bhs_common ) ]; }; -- cgit v1.2.3-55-g7522