From 55dfc375cf65eebe11b740960656b099b90c25fe Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Mon, 30 Apr 2018 11:35:22 +0200 Subject: [PATCH] examples/vhost: fix header copy to discontiguous desc buffer 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 --- examples/vhost/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c index 5a965a3468..8ea6b36d59 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; -- 2.20.1