diff options
author | Damjan Marion <damarion@cisco.com> | 2018-02-08 19:49:22 +0100 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2018-02-24 18:59:38 +0100 |
commit | c17f55d31f2e2f45939e37eccf2cd1c7ea4acd07 (patch) | |
tree | a2079d2d1040ba8fbdf92d7985d6c9a3ef28103f /src | |
parent | fdb47ad887957cf677de39c31a7e9d8656ce61fb (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)) { |