diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index 12da329f34b4..b9bf8153ab1b 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -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, diff --git a/sys/dev/nvmf/nvmf_tcp.h b/sys/dev/nvmf/nvmf_tcp.h index 00b0917f75a4..78d6cf17a977 100644 --- a/sys/dev/nvmf/nvmf_tcp.h +++ b/sys/dev/nvmf/nvmf_tcp.h @@ -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);