From: Pierre Riteau Date: Wed, 25 Nov 2009 18:49:34 +0000 (+0000) Subject: net: fix TAP networking on host kernels without IFF_VNET_HDR support X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6720b35b8186e9c6a9f137c02f8c2c1e7c98085f;p=qemu.git 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 Signed-off-by: Mark McLoughlin Signed-off-by: Anthony Liguori --- diff --git a/net/tap-linux.c b/net/tap-linux.c index 0f621a2315..e4f7e2723b 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c @@ -52,6 +52,8 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required features & IFF_VNET_HDR) { *vnet_hdr = 1; ifr.ifr_flags |= IFF_VNET_HDR; + } else { + *vnet_hdr = 0; } if (vnet_hdr_required && !*vnet_hdr) {