From patchwork Wed Nov 25 18:49:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 39435 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 3C9F2B6EEF for ; Thu, 26 Nov 2009 06:34:37 +1100 (EST) Received: from localhost ([127.0.0.1]:52731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDNdK-00020F-3C for incoming@patchwork.ozlabs.org; Wed, 25 Nov 2009 14:34:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDMym-0007S5-TV for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDMyc-0007Kr-8v for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:36 -0500 Received: from [199.232.76.173] (port=49018 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDMyc-0007KZ-1k for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63973) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDMyb-0000G0-Cr for qemu-devel@nongnu.org; Wed, 25 Nov 2009 13:52:29 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAPIqQ1p028332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Nov 2009 13:52:26 -0500 Received: from blaa.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAPIqMlR030217; Wed, 25 Nov 2009 13:52:26 -0500 Received: by blaa.localdomain (Postfix, from userid 500) id 7408CB0B4; Wed, 25 Nov 2009 18:49:43 +0000 (GMT) From: Mark McLoughlin To: qemu-devel@nongnu.org Date: Wed, 25 Nov 2009 18:49:34 +0000 Message-Id: <1259174977-26212-42-git-send-email-markmc@redhat.com> In-Reply-To: <1259174977-26212-1-git-send-email-markmc@redhat.com> References: <1259174977-26212-1-git-send-email-markmc@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Mark McLoughlin , Pierre Riteau Subject: [Qemu-devel] [PATCH 41/44] net: 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 From: 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 Signed-off-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) {