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: 82c93a567d ("examples/vhost: move to safe GPA translation API")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
Maxime Coquelin 2018-04-30 11:35:22 +02:00 committed by Ferruh Yigit
parent bfbf0143d1
commit 55dfc375cf

View file

@ -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;