From 508cabcec8f462aafcce6d101451806a251bd601 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 8 Feb 2018 19:49:22 +0100 Subject: virtio: reset vnet header on tx Change-Id: Ib04a8787038fb536470a04d99fdc165102edfb5a Signed-off-by: Damjan Marion --- src/vnet/devices/virtio/device.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vnet/devices') diff --git a/src/vnet/devices/virtio/device.c b/src/vnet/devices/virtio/device.c index 5528ddb0429..ae8a116efee 100644 --- a/src/vnet/devices/virtio/device.c +++ b/src/vnet/devices/virtio/device.c @@ -130,6 +130,9 @@ add_buffer_to_slot (vlib_main_t * vm, virtio_vring_t * vring, u32 bi, struct vring_desc *d; d = &vring->desc[next]; vlib_buffer_t *b = vlib_get_buffer (vm, bi); + struct virtio_net_hdr_v1 *hdr = vlib_buffer_get_current (b) - hdr_sz; + + memset (hdr, 0, hdr_sz); if (PREDICT_TRUE ((b->flags & VLIB_BUFFER_NEXT_PRESENT) == 0)) { -- cgit 1.2.3-korg