mirror of
https://github.com/qemu/qemu.git
synced 2025-08-10 12:46:22 +00:00
net: fix TAP networking on host kernels without IFF_VNET_HDR support
vnet_hdr is initialized at 1 by default. We need to reset it to 0 if the kernel doesn't support IFF_VNET_HDR. Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
0f2fbf40a9
commit
6720b35b81
@ -52,6 +52,8 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
|
|||||||
features & IFF_VNET_HDR) {
|
features & IFF_VNET_HDR) {
|
||||||
*vnet_hdr = 1;
|
*vnet_hdr = 1;
|
||||||
ifr.ifr_flags |= IFF_VNET_HDR;
|
ifr.ifr_flags |= IFF_VNET_HDR;
|
||||||
|
} else {
|
||||||
|
*vnet_hdr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vnet_hdr_required && !*vnet_hdr) {
|
if (vnet_hdr_required && !*vnet_hdr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user