diff mbox

[1/1] net: fix vnet_hdr bustage with slirp

Message ID 1249634851-24005-1-git-send-email-markmc@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mark McLoughlin Aug. 7, 2009, 8:47 a.m. UTC
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 <markmc@redhat.com>
---
 net.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Comments

Avi Kivity Aug. 9, 2009, 9:53 a.m. UTC | #1
On 08/07/2009 11:47 AM, Mark McLoughlin wrote:
> 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.
>
>    

Applied, thanks.

> [Needed on stable-0.11 too]
>    

There as well.
diff mbox

Patch

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;