@@ -107,8 +107,8 @@ struct iscsi_context {
|
||||
uint32_t target_max_recv_data_segment_length;
|
||||
enum iscsi_initial_r2t want_initial_r2t;
|
||||
enum iscsi_initial_r2t use_initial_r2t;
|
||||
enum iscsi_initial_r2t want_immediate_data;
|
||||
enum iscsi_initial_r2t use_immediate_data;
|
||||
enum iscsi_immediate_data want_immediate_data;
|
||||
enum iscsi_immediate_data use_immediate_data;
|
||||
};
|
||||
|
||||
#define ISCSI_PDU_IMMEDIATE 0x40
|
||||
|
||||
@@ -195,7 +195,8 @@ enum iscsi_header_digest {
|
||||
ISCSI_HEADER_DIGEST_NONE = 0,
|
||||
ISCSI_HEADER_DIGEST_NONE_CRC32C = 1,
|
||||
ISCSI_HEADER_DIGEST_CRC32C_NONE = 2,
|
||||
ISCSI_HEADER_DIGEST_CRC32C = 3
|
||||
ISCSI_HEADER_DIGEST_CRC32C = 3,
|
||||
ISCSI_HEADER_DIGEST_LAST = ISCSI_HEADER_DIGEST_CRC32C
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -282,6 +282,10 @@ iscsi_set_header_digest(struct iscsi_context *iscsi,
|
||||
"logged in");
|
||||
return -1;
|
||||
}
|
||||
if ((unsigned)header_digest > ISCSI_HEADER_DIGEST_LAST) {
|
||||
iscsi_set_error(iscsi, "invalid header digest value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
iscsi->want_header_digest = header_digest;
|
||||
|
||||
|
||||
@@ -188,6 +188,9 @@ iscsi_login_add_headerdigest(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
|
||||
case ISCSI_HEADER_DIGEST_CRC32C:
|
||||
str = (char *)"HeaderDigest=CRC32C";
|
||||
break;
|
||||
default:
|
||||
iscsi_set_error(iscsi, "invalid header digest value");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
|
||||
|
||||
@@ -805,6 +805,10 @@ scsi_modesense_datain_unmarshall(struct scsi_task *task)
|
||||
case SCSI_MODESENSE_PAGECODE_INFORMATIONAL_EXCEPTIONS_CONTROL:
|
||||
scsi_parse_mode_informational_exceptions_control(task, pos, mp);
|
||||
break;
|
||||
default:
|
||||
/* TODO: process other pages, or add raw data to struct
|
||||
* scsi_mode_page. */
|
||||
break;
|
||||
}
|
||||
|
||||
mp->next = ms->pages;
|
||||
@@ -1082,7 +1086,7 @@ scsi_get_task_private_ptr(struct scsi_task *task)
|
||||
|
||||
struct scsi_data_buffer {
|
||||
struct scsi_data_buffer *next;
|
||||
int len;
|
||||
uint32_t len;
|
||||
unsigned char *data;
|
||||
};
|
||||
|
||||
@@ -1091,6 +1095,9 @@ scsi_task_add_data_in_buffer(struct scsi_task *task, int len, unsigned char *buf
|
||||
{
|
||||
struct scsi_data_buffer *data_buf;
|
||||
|
||||
if (len < 0) {
|
||||
return -1;
|
||||
}
|
||||
data_buf = scsi_malloc(task, sizeof(struct scsi_data_buffer));
|
||||
if (data_buf == NULL) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user