From: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
To: stefanha@redhat.com
Cc: davem@davemloft.net, jhansen@vmware.com, cavery@redhat.com,
borntraeger@de.ibm.com, fiuczy@linux.ibm.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems
Date: Wed, 20 Jun 2018 15:51:51 +0200 [thread overview]
Message-ID: <1529502711-8028-1-git-send-email-imbrenda@linux.vnet.ibm.com> (raw)
The dst_cid and src_cid are 64 bits, therefore 64 bit accessors should be
used, and in fact in virtio_transport_common.c only 64 bit accessors are
used. Using 32 bit accessors for 64 bit values breaks big endian systems.
This patch fixes a wrong use of le32_to_cpu in virtio_transport_send_pkt.
Fixes: b9116823189e85ccf384 ("VSOCK: add loopback to virtio_transport")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
---
net/vmw_vsock/virtio_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 8e03bd3..5d3cce9 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -201,7 +201,7 @@ virtio_transport_send_pkt(struct virtio_vsock_pkt *pkt)
return -ENODEV;
}
- if (le32_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid)
+ if (le64_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid)
return virtio_transport_send_pkt_loopback(vsock, pkt);
if (pkt->reply)
--
2.7.4
next reply other threads:[~2018-06-20 13:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 13:51 Claudio Imbrenda [this message]
2018-06-21 16:07 ` [PATCH v1 1/1] VSOCK: fix loopback on big-endian systems Stefan Hajnoczi
2018-06-22 0:34 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1529502711-8028-1-git-send-email-imbrenda@linux.vnet.ibm.com \
--to=imbrenda@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cavery@redhat.com \
--cc=davem@davemloft.net \
--cc=fiuczy@linux.ibm.com \
--cc=jhansen@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox