summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPierre Riteau <Pierre.Riteau@irisa.fr>2009-11-25 18:49:34 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:35 -0600
commit6d87d6e92be0d8fd89b0ce55a47a02b68faaa39c (patch)
tree78a91e27a7323fb3333833f348dd7d552fed775a /net
parent4736d80c3ee101a0dae9964929552fc7d7715aa4 (diff)
downloadqemu-6d87d6e92be0d8fd89b0ce55a47a02b68faaa39c.tar.gz
qemu-6d87d6e92be0d8fd89b0ce55a47a02b68faaa39c.tar.bz2
qemu-6d87d6e92be0d8fd89b0ce55a47a02b68faaa39c.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/tap-linux.c2
1 files changed, 2 insertions, 0 deletions
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) {