瀏覽代碼

[iscsi] Don't close when receiving NOP-In

Some iSCSI targets send NOP-In.  Rather than closing the connection
when we receive one, it is more user friendly to log a debug message
and keep the connection open.  Eventually, it would be nice if iPXE
supported replying to NOP-Ins, but we might as well keep the
connection open until the target disconnects us.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Vishvananda Ishaya Abrams 7 年之前
父節點
當前提交
4524cc11bf
共有 1 個檔案被更改,包括 8 行新增9 行删除
  1. 8
    9
      src/net/tcp/iscsi.c

+ 8
- 9
src/net/tcp/iscsi.c 查看文件

@@ -109,10 +109,6 @@ FEATURE ( FEATURE_PROTOCOL, "iSCSI", DHCP_EB_FEATURE_ISCSI, 1 );
109 109
 	__einfo_error ( EINFO_ENOTSUP_TARGET_STATUS )
110 110
 #define EINFO_ENOTSUP_TARGET_STATUS \
111 111
 	__einfo_uniqify ( EINFO_ENOTSUP, 0x04, "Unsupported target status" )
112
-#define ENOTSUP_NOP_IN \
113
-	__einfo_error ( EINFO_ENOTSUP_NOP_IN )
114
-#define EINFO_ENOTSUP_NOP_IN \
115
-	__einfo_uniqify ( EINFO_ENOTSUP, 0x05, "Unsupported NOP-In received" )
116 112
 #define EPERM_INITIATOR_AUTHENTICATION \
117 113
 	__einfo_error ( EINFO_EPERM_INITIATOR_AUTHENTICATION )
118 114
 #define EINFO_EPERM_INITIATOR_AUTHENTICATION \
@@ -620,12 +616,15 @@ static int iscsi_rx_nop_in ( struct iscsi_session *iscsi,
620 616
 	 * sent as ping requests, but we can happily accept NOP-Ins
621 617
 	 * sent merely to update CmdSN.
622 618
 	 */
623
-	if ( nop_in->ttt != htonl ( ISCSI_TAG_RESERVED ) ) {
624
-		DBGC ( iscsi, "iSCSI %p received unsupported NOP-In with TTT "
625
-		       "%08x\n", iscsi, ntohl ( nop_in->ttt ) );
626
-		return -ENOTSUP_NOP_IN;
627
-	}
619
+	if ( nop_in->ttt == htonl ( ISCSI_TAG_RESERVED ) )
620
+		return 0;
628 621
 
622
+	/* Ignore any other NOP-Ins.  The target may eventually
623
+	 * disconnect us for failing to respond, but this minimises
624
+	 * unnecessary connection closures.
625
+	 */
626
+	DBGC ( iscsi, "iSCSI %p received unsupported NOP-In with TTT %08x\n",
627
+	       iscsi, ntohl ( nop_in->ttt ) );
629 628
 	return 0;
630 629
 }
631 630
 

Loading…
取消
儲存