Skip to content

Commit 3a96bff

Browse files
Christoph Hellwigkeithbusch
authored andcommitted
nvmet-tcp: fix a missing endianess conversion in nvmet_tcp_try_peek_pdu
No, a __le32 cast doesn't magically byteswap on big-endian systems.. Fixes: 70525e5 ("nvmet-tcp: peek icreq before starting TLS") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 2abd2c3 commit 3a96bff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvme/target/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ static int nvmet_tcp_try_peek_pdu(struct nvmet_tcp_queue *queue)
17781778
(int)sizeof(struct nvme_tcp_icreq_pdu));
17791779
if (hdr->type == nvme_tcp_icreq &&
17801780
hdr->hlen == sizeof(struct nvme_tcp_icreq_pdu) &&
1781-
hdr->plen == (__le32)sizeof(struct nvme_tcp_icreq_pdu)) {
1781+
hdr->plen == cpu_to_le32(sizeof(struct nvme_tcp_icreq_pdu))) {
17821782
pr_debug("queue %d: icreq detected\n",
17831783
queue->idx);
17841784
return len;

0 commit comments

Comments
 (0)