From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCrMd-0002QR-7U for qemu-devel@nongnu.org; Tue, 24 Nov 2009 04:07:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCrMY-0002OQ-N3 for qemu-devel@nongnu.org; Tue, 24 Nov 2009 04:07:10 -0500 Received: from [199.232.76.173] (port=38356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCrMY-0002OB-Gf for qemu-devel@nongnu.org; Tue, 24 Nov 2009 04:07:06 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:39099) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1NCrMY-0001W5-2r for qemu-devel@nongnu.org; Tue, 24 Nov 2009 04:07:06 -0500 From: Pierre Riteau Date: Tue, 24 Nov 2009 10:06:33 +0100 Message-Id: <1259053593-15362-1-git-send-email-Pierre.Riteau@irisa.fr> Subject: [Qemu-devel] [PATCH] Fix TAP networking on host kernels without IFF_VNET_HDR support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Mark McLoughlin Cc: Pierre Riteau 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 --- net/tap-linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/net/tap-linux.c b/net/tap-linux.c index 0f621a2..e4f7e27 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) { -- 1.6.5