fix warning from -Wuninitialized
This commit is contained in:
+2
-1
@@ -195,7 +195,8 @@ enum iscsi_header_digest {
|
|||||||
ISCSI_HEADER_DIGEST_NONE = 0,
|
ISCSI_HEADER_DIGEST_NONE = 0,
|
||||||
ISCSI_HEADER_DIGEST_NONE_CRC32C = 1,
|
ISCSI_HEADER_DIGEST_NONE_CRC32C = 1,
|
||||||
ISCSI_HEADER_DIGEST_CRC32C_NONE = 2,
|
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");
|
"logged in");
|
||||||
return -1;
|
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;
|
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:
|
case ISCSI_HEADER_DIGEST_CRC32C:
|
||||||
str = (char *)"HeaderDigest=CRC32C";
|
str = (char *)"HeaderDigest=CRC32C";
|
||||||
break;
|
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)
|
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
|
||||||
|
|||||||
Reference in New Issue
Block a user