PDU use serial32 arithmetic for cmdsn, maxcmdsn and expcmdsn.
RFC3720 says that cmdsn comparison must be done using serial32 arithmetic. This will definetly avoid a deadlock if cmdsn wraps from 2^32-1 to 0. Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
@@ -335,7 +335,7 @@ iscsi_process_scsi_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
|
||||
}
|
||||
|
||||
maxcmdsn = scsi_get_uint32(&in->hdr[32]);
|
||||
if (maxcmdsn > iscsi->maxcmdsn) {
|
||||
if (iscsi_serial32_compare(maxcmdsn,iscsi->maxcmdsn) > 0) {
|
||||
iscsi->maxcmdsn = maxcmdsn;
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ iscsi_process_scsi_data_in(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
|
||||
}
|
||||
|
||||
maxcmdsn = scsi_get_uint32(&in->hdr[32]);
|
||||
if (maxcmdsn > iscsi->maxcmdsn) {
|
||||
if (iscsi_serial32_compare(maxcmdsn,iscsi->maxcmdsn) > 0) {
|
||||
iscsi->maxcmdsn = maxcmdsn;
|
||||
}
|
||||
|
||||
@@ -542,7 +542,7 @@ iscsi_process_r2t(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
|
||||
len = scsi_get_uint32(&in->hdr[44]);
|
||||
|
||||
maxcmdsn = scsi_get_uint32(&in->hdr[32]);
|
||||
if (maxcmdsn > iscsi->maxcmdsn) {
|
||||
if (iscsi_serial32_compare(maxcmdsn,iscsi->maxcmdsn) > 0) {
|
||||
iscsi->maxcmdsn = maxcmdsn;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user