Thread (19 messages) 19 messages, 5 authors, 2013-06-29

Re: [RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko

From: Asias He <hidden>
Date: 2013-06-29 23:45:50
Also in: kvm, virtualization

Hi David,

On Fri, Jun 28, 2013 at 09:32:25PM -0700, David Miller wrote:
From: Asias He <redacted>
Date: Thu, 27 Jun 2013 16:00:01 +0800
quoted
+static void
+virtio_transport_recv_dgram(struct sock *sk,
+			    struct virtio_vsock_pkt *pkt)
 ...
quoted
+	memcpy(skb->data, pkt, sizeof(*pkt));
+	memcpy(skb->data + sizeof(*pkt), pkt->buf, pkt->len);
Are you sure this is right?

Shouldn't you be using "sizeof(struct virtio_vsock_hdr)" instead of
"sizeof(*pkt)".  'pkt' is "struct virtio_vsock_pkt" and has all kinds
of meta-data you probably don't mean to include in the SKB.
Right, virtio_vsock_hdr is enough. Will fix this.

Thanks for looking at this. 

-- 
Asias
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help