From 3a29351dac38b9cc6d2386938ed91852f73ef678 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 16 Apr 2011 16:26:04 +1000 Subject: [PATCH] Read out the residual count correctly from the scsi reply --- lib/scsi-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scsi-command.c b/lib/scsi-command.c index 03afb99..c1c169e 100644 --- a/lib/scsi-command.c +++ b/lib/scsi-command.c @@ -359,7 +359,7 @@ iscsi_process_scsi_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu, * These flags should only be set if the S flag is also set */ if (flags & (ISCSI_PDU_DATA_RESIDUAL_OVERFLOW|ISCSI_PDU_DATA_RESIDUAL_UNDERFLOW)) { - task->residual = ntohl(&in->hdr[44]); + task->residual = ntohl(*((uint32_t *)&in->hdr[44])); if (flags & ISCSI_PDU_DATA_RESIDUAL_UNDERFLOW) { task->residual_status = SCSI_RESIDUAL_UNDERFLOW; } else {