aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2007-12-13 13:43:37 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:28:45 -0500
commit7a53dc52a5f218bf306b875bf0610e851d5a8268 (patch)
treee7f170d68959062d5f34e5a8d6e9501b992e471a
parent03766a1d4e4520066d3ed2097bfdf6e606aba828 (diff)
[SCSI] iscsi_tcp: drop session when itt does not match any command
A target should never send us a itt that does not match a running task. If it does we do not really know what is coming down after the header, unless we evaluate the hdr and do some guessing sometimes. However, even if we know what is coming we probably do not have buffers for it or we cannot respond (if it is a r2t for example), so just drop the session. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/iscsi_tcp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index ecba606e6521..65df908019fd 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -755,11 +755,7 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
755 opcode = hdr->opcode & ISCSI_OPCODE_MASK; 755 opcode = hdr->opcode & ISCSI_OPCODE_MASK;
756 /* verify itt (itt encoding: age+cid+itt) */ 756 /* verify itt (itt encoding: age+cid+itt) */
757 rc = iscsi_verify_itt(conn, hdr, &itt); 757 rc = iscsi_verify_itt(conn, hdr, &itt);
758 if (rc == ISCSI_ERR_NO_SCSI_CMD) { 758 if (rc)
759 /* XXX: what does this do? */
760 tcp_conn->in.datalen = 0; /* force drop */
761 return 0;
762 } else if (rc)
763 return rc; 759 return rc;
764 760
765 debug_tcp("opcode 0x%x ahslen %d datalen %d\n", 761 debug_tcp("opcode 0x%x ahslen %d datalen %d\n",