From patchwork Tue Nov 24 09:06:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Riteau X-Patchwork-Id: 39191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D2ABDB7BBC for ; Tue, 24 Nov 2009 20:24:14 +1100 (EST) Received: from localhost ([127.0.0.1]:59846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCrd4-0002Ru-3q for incoming@patchwork.ozlabs.org; Tue, 24 Nov 2009 04:24:10 -0500 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 X-IronPort-AV: E=Sophos;i="4.47,276,1257116400"; d="scan'208";a="40682854" Received: from elfe.irisa.fr (HELO localhost.localdomain) ([131.254.60.12]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Nov 2009 10:07:01 +0100 From: Pierre Riteau To: qemu-devel@nongnu.org, Mark McLoughlin Date: Tue, 24 Nov 2009 10:06:33 +0100 Message-Id: <1259053593-15362-1-git-send-email-Pierre.Riteau@irisa.fr> X-Mailer: git-send-email 1.6.5 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Pierre Riteau Subject: [Qemu-devel] [PATCH] Fix TAP networking on host kernels without IFF_VNET_HDR support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Acked-by: Mark McLoughlin --- 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) {