From 2f9fda19d2baf19ce2b30e5f6449659ff2898fc1 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Sat, 15 Dec 2012 13:24:01 +0100 Subject: [PATCH] SOCKET do not queue PDUs with itt==0xffffffff head of queue Queing packets with itt = 0xffffffff (e.g. NOP-Out replies) ahead of queue because they might have a higher CmdSN than following packets. This again could lead to a deadlock AND its a protocol violotion: RFC3720 Section 3.2.2.1 second last paragraph on Page 21: "On any connection, the iSCSI initiator MUST send the commands in increasing order of CmdSN, except for commands that are retransmitted due to digest error recovery and connection recovery." Signed-off-by: Peter Lieven --- lib/socket.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/socket.c b/lib/socket.c index b448ff5..7e4f703 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -63,11 +63,9 @@ iscsi_add_to_outqueue(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) /* queue pdus in ascending order of itt. * ensure that pakets with the same itt are kept in order. - * queue pdus with itt = 0xffffffff (SNACK / DataACK) in order but at head of queue. */ do { - if (iscsi_serial32_compare(pdu->itt, current->itt) < 0 - || (pdu->itt == 0xffffffff && current->itt != 0xffffffff)) { + if (iscsi_serial32_compare(pdu->itt, current->itt) < 0) { /* insert PDU before the current */ if (last != NULL) { last->next=pdu;