diff options
author | Damjan Marion <damarion@cisco.com> | 2018-02-08 19:49:22 +0100 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2018-02-08 22:20:12 +0000 |
commit | 508cabcec8f462aafcce6d101451806a251bd601 (patch) | |
tree | 1bf44701e7032c4ef6bedcd72e214272cd56de96 /src | |
parent | 2ae5135e4cc47f5be8895486a91ad98be36dd5dd (diff) |
virtio: reset vnet header on tx
Change-Id: Ib04a8787038fb536470a04d99fdc165102edfb5a
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/devices/virtio/device.c | 3 |
1 files changed, 3 insertions, 0 deletions
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)) { |