summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorVishvananda Ishaya Abrams2017-03-09 15:23:22 +0100
committerMichael Brown2017-03-09 15:23:22 +0100
commit4524cc11bfc5628e620cf4b42785ee6aee16ccb0 (patch)
treea9490a9b69df776db1baf231b865ec1ba3b6d7f4 /src/net
parent[intel] Reset all virtual function settings (diff)
downloadipxe-4524cc11bfc5628e620cf4b42785ee6aee16ccb0.tar.gz
ipxe-4524cc11bfc5628e620cf4b42785ee6aee16ccb0.tar.xz
ipxe-4524cc11bfc5628e620cf4b42785ee6aee16ccb0.zip
[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>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tcp/iscsi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c
index 51d09ddc..1e6fd1f5 100644
--- a/src/net/tcp/iscsi.c
+++ b/src/net/tcp/iscsi.c
@@ -109,10 +109,6 @@ FEATURE ( FEATURE_PROTOCOL, "iSCSI", DHCP_EB_FEATURE_ISCSI, 1 );
__einfo_error ( EINFO_ENOTSUP_TARGET_STATUS )
#define EINFO_ENOTSUP_TARGET_STATUS \
__einfo_uniqify ( EINFO_ENOTSUP, 0x04, "Unsupported target status" )
-#define ENOTSUP_NOP_IN \
- __einfo_error ( EINFO_ENOTSUP_NOP_IN )
-#define EINFO_ENOTSUP_NOP_IN \
- __einfo_uniqify ( EINFO_ENOTSUP, 0x05, "Unsupported NOP-In received" )
#define EPERM_INITIATOR_AUTHENTICATION \
__einfo_error ( EINFO_EPERM_INITIATOR_AUTHENTICATION )
#define EINFO_EPERM_INITIATOR_AUTHENTICATION \
@@ -620,12 +616,15 @@ static int iscsi_rx_nop_in ( struct iscsi_session *iscsi,
* sent as ping requests, but we can happily accept NOP-Ins
* sent merely to update CmdSN.
*/
- if ( nop_in->ttt != htonl ( ISCSI_TAG_RESERVED ) ) {
- DBGC ( iscsi, "iSCSI %p received unsupported NOP-In with TTT "
- "%08x\n", iscsi, ntohl ( nop_in->ttt ) );
- return -ENOTSUP_NOP_IN;
- }
+ if ( nop_in->ttt == htonl ( ISCSI_TAG_RESERVED ) )
+ return 0;
+ /* Ignore any other NOP-Ins. The target may eventually
+ * disconnect us for failing to respond, but this minimises
+ * unnecessary connection closures.
+ */
+ DBGC ( iscsi, "iSCSI %p received unsupported NOP-In with TTT %08x\n",
+ iscsi, ntohl ( nop_in->ttt ) );
return 0;
}