Skip to content

Commit d8530e8

Browse files
Claudio Imbrendagregkh
authored andcommitted
VSOCK: fix loopback on big-endian systems
[ Upstream commit e5ab564 ] 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: b911682 ("VSOCK: add loopback to virtio_transport") Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7eba653 commit d8530e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/vmw_vsock/virtio_transport.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ virtio_transport_send_pkt(struct virtio_vsock_pkt *pkt)
201201
return -ENODEV;
202202
}
203203

204-
if (le32_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid)
204+
if (le64_to_cpu(pkt->hdr.dst_cid) == vsock->guest_cid)
205205
return virtio_transport_send_pkt_loopback(vsock, pkt);
206206

207207
if (pkt->reply)

0 commit comments

Comments
 (0)