[dpdk-dev,1/2] examples/vhost: fix header copy to discontiguous desc buffer

Message ID 20180430093523.12495-2-maxime.coquelin@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Maxime Coquelin April 30, 2018, 9:35 a.m. UTC
  In the loop to copy virtio-net header to the descriptor buffer,
destination pointer was incremented instead of the source
pointer.

Coverity issue: 277240
Fixes: 82c93a567d3b ("examples/vhost: move to safe GPA translation API")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 examples/vhost/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c
index 5a965a346..8ea6b36d5 100644
--- a/examples/vhost/virtio_net.c
+++ b/examples/vhost/virtio_net.c
@@ -103,7 +103,7 @@  enqueue_pkt(struct vhost_dev *dev, struct rte_vhost_vring *vr,
 
 			remain -= len;
 			guest_addr += len;
-			dst += len;
+			src += len;
 		}
 
 		desc_chunck_len = desc->len - dev->hdr_len;