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 <pl@kamp.de>
This commit is contained in:
Peter Lieven
2012-12-15 13:24:01 +01:00
parent 735e3063ad
commit 2f9fda19d2

View File

@@ -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;