mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 03:04:34 +01:00
nvmf_tcp: Correct tests for PDU direction
Add parentheses to ensure the correct order of operations. Reported by: GCC
This commit is contained in:
parent
e75a79f40b
commit
a7db82cfd9
@ -803,7 +803,7 @@ nvmf_tcp_validate_ic_pdu(struct nvmf_association *na, struct nvmf_tcp_qpair *qp,
|
||||
/* Validate pdu_type. */
|
||||
|
||||
/* Controllers only receive PDUs with a PDU direction of 0. */
|
||||
if (na->na_controller != (ch->pdu_type & 0x01) == 0) {
|
||||
if (na->na_controller != ((ch->pdu_type & 0x01) == 0)) {
|
||||
na_error(na, "NVMe/TCP: Invalid PDU type %u", ch->pdu_type);
|
||||
nvmf_tcp_report_error(na, qp,
|
||||
NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 0, ch, pdu_len,
|
||||
|
@ -50,7 +50,7 @@ nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch,
|
||||
/* Validate pdu_type. */
|
||||
|
||||
/* Controllers only receive PDUs with a PDU direction of 0. */
|
||||
if (controller != (ch->pdu_type & 0x01) == 0) {
|
||||
if (controller != ((ch->pdu_type & 0x01) == 0)) {
|
||||
printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type);
|
||||
*fes = NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD;
|
||||
*fei = offsetof(struct nvme_tcp_common_pdu_hdr, pdu_type);
|
||||
|
Loading…
Reference in New Issue
Block a user