Add tracking of MAXCMDSN

This commit is contained in:
Ronnie Sahlberg
2012-08-02 09:09:22 +10:00
parent 439f68e555
commit 71be26ad03
4 changed files with 42 additions and 8 deletions

View File

@@ -21,6 +21,7 @@
#endif
#include <stdio.h>
#include <arpa/inet.h>
#include "iscsi.h"
#include "iscsi-private.h"
#include "scsi-lowlevel.h"
@@ -82,10 +83,15 @@ int
iscsi_process_task_mgmt_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
struct iscsi_in_pdu *in)
{
uint32_t response;
uint32_t response, maxcmdsn;
response = in->hdr[2];
maxcmdsn = ntohl(*(uint32_t *)&in->hdr[32]);
if (maxcmdsn > iscsi->maxcmdsn) {
iscsi->maxcmdsn = maxcmdsn;
}
pdu->callback(iscsi, SCSI_STATUS_GOOD, &response, pdu->private_data);
return 0;