From patchwork Fri Aug 7 08:47:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 39807 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n778t0KL021760 for ; Fri, 7 Aug 2009 08:55:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757235AbZHGIyt (ORCPT ); Fri, 7 Aug 2009 04:54:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757233AbZHGIyt (ORCPT ); Fri, 7 Aug 2009 04:54:49 -0400 Received: from mail28.svc.cra.dublin.eircom.net ([159.134.118.224]:42746 "HELO mail28.svc.cra.dublin.eircom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757231AbZHGIys (ORCPT ); Fri, 7 Aug 2009 04:54:48 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Fri, 07 Aug 2009 04:54:48 EDT Received: (qmail 73056 messnum 3530348 invoked from network[83.71.44.161/83-71-44-161-dynamic.b-ras1.srl.dublin.eircom.net]); 7 Aug 2009 08:48:09 -0000 Received: from 83-71-44-161-dynamic.b-ras1.srl.dublin.eircom.net (HELO blaa.localdomain) (83.71.44.161) by mail28.svc.cra.dublin.eircom.net (qp 73056) with SMTP; 7 Aug 2009 08:48:09 -0000 Received: by blaa.localdomain (Postfix, from userid 500) id 04C985AB8; Fri, 7 Aug 2009 09:47:31 +0100 (IST) From: Mark McLoughlin To: avi@redhat.com Cc: kvm@vger.kernel.org, Mark McLoughlin Subject: [PATCH 1/1] net: fix vnet_hdr bustage with slirp Date: Fri, 7 Aug 2009 09:47:31 +0100 Message-Id: <1249634851-24005-1-git-send-email-markmc@redhat.com> X-Mailer: git-send-email 1.6.2.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org slirp has started using VLANClientState::opaque and this has caused the kvm specific tap_has_vnet_hdr() hack to break because we blindly use this opaque pointer even if it is not a tap client. Add yet another hack to check that we're actually getting called with a tap client. [Needed on stable-0.11 too] Signed-off-by: Mark McLoughlin --- net.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net.c b/net.c index c7702f8..2428f63 100644 --- a/net.c +++ b/net.c @@ -1521,6 +1521,9 @@ int tap_has_vnet_hdr(void *opaque) VLANClientState *vc = opaque; TAPState *s = vc->opaque; + if (vc->receive != tap_receive) + return 0; + return s ? s->has_vnet_hdr : 0; } @@ -1529,6 +1532,9 @@ void tap_using_vnet_hdr(void *opaque, int using_vnet_hdr) VLANClientState *vc = opaque; TAPState *s = vc->opaque; + if (vc->receive != tap_receive) + return; + if (!s || !s->has_vnet_hdr) return;