mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
net: Move virtio-net header length assertion
The virtio-net header length assertion should happen for any clients. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
4b52d63249
commit
a67753710d
2 changed files with 5 additions and 3 deletions
|
@ -56,6 +56,7 @@
|
|||
#include "net/filter.h"
|
||||
#include "qapi/string-output-visitor.h"
|
||||
#include "qapi/qobject-input-visitor.h"
|
||||
#include "standard-headers/linux/virtio_net.h"
|
||||
|
||||
/* Net bridge is currently not supported for W32. */
|
||||
#if !defined(_WIN32)
|
||||
|
@ -550,6 +551,10 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
|
|||
return;
|
||||
}
|
||||
|
||||
assert(len == sizeof(struct virtio_net_hdr_mrg_rxbuf) ||
|
||||
len == sizeof(struct virtio_net_hdr) ||
|
||||
len == sizeof(struct virtio_net_hdr_v1_hash));
|
||||
|
||||
nc->vnet_hdr_len = len;
|
||||
nc->info->set_vnet_hdr_len(nc, len);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue