]> git.proxmox.com Git - qemu.git/commitdiff
net: fix TAP networking on host kernels without IFF_VNET_HDR support
authorPierre Riteau <Pierre.Riteau@irisa.fr>
Wed, 25 Nov 2009 18:49:34 +0000 (18:49 +0000)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 3 Dec 2009 15:41:35 +0000 (09:41 -0600)
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>
net/tap-linux.c

index 0f621a2315d323ffde277cc2eda483118d7b3567..e4f7e2723b76bff4b16512bd1dcedf2dc66656c5 100644 (file)
@@ -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) {