|
Mark McLoughlin |
0c2ae8 |
From 97064ad88123744056d141e96247348dd2d9621c Mon Sep 17 00:00:00 2001
|
|
Mark McLoughlin |
0c2ae8 |
From: Mark McLoughlin <markmc@redhat.com>
|
|
Mark McLoughlin |
0c2ae8 |
Date: Fri, 7 Aug 2009 09:39:51 +0100
|
|
Mark McLoughlin |
0c2ae8 |
Subject: [PATCH] net: fix vnet_hdr bustage with slirp
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
slirp has started using VLANClientState::opaque and this has caused the
|
|
Mark McLoughlin |
0c2ae8 |
kvm specific tap_has_vnet_hdr() hack to break because we blindly use
|
|
Mark McLoughlin |
0c2ae8 |
this opaque pointer even if it is not a tap client.
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
Add yet another hack to check that we're actually getting called with a
|
|
Mark McLoughlin |
0c2ae8 |
tap client.
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
[Needed on stable-0.11 too]
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
Mark McLoughlin |
0c2ae8 |
Fedora-patch: qemu-fix-vnet-hdr-slirp-bustage.patch
|
|
Mark McLoughlin |
0c2ae8 |
---
|
|
Mark McLoughlin |
0c2ae8 |
net.c | 6 ++++++
|
|
Mark McLoughlin |
0c2ae8 |
1 files changed, 6 insertions(+), 0 deletions(-)
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
diff --git a/net.c b/net.c
|
|
Mark McLoughlin |
0c2ae8 |
index c7702f8..2428f63 100644
|
|
Mark McLoughlin |
0c2ae8 |
--- a/net.c
|
|
Mark McLoughlin |
0c2ae8 |
+++ b/net.c
|
|
Mark McLoughlin |
0c2ae8 |
@@ -1521,6 +1521,9 @@ int tap_has_vnet_hdr(void *opaque)
|
|
Mark McLoughlin |
0c2ae8 |
VLANClientState *vc = opaque;
|
|
Mark McLoughlin |
0c2ae8 |
TAPState *s = vc->opaque;
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
+ if (vc->receive != tap_receive)
|
|
Mark McLoughlin |
0c2ae8 |
+ return 0;
|
|
Mark McLoughlin |
0c2ae8 |
+
|
|
Mark McLoughlin |
0c2ae8 |
return s ? s->has_vnet_hdr : 0;
|
|
Mark McLoughlin |
0c2ae8 |
}
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
@@ -1529,6 +1532,9 @@ void tap_using_vnet_hdr(void *opaque, int using_vnet_hdr)
|
|
Mark McLoughlin |
0c2ae8 |
VLANClientState *vc = opaque;
|
|
Mark McLoughlin |
0c2ae8 |
TAPState *s = vc->opaque;
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
+ if (vc->receive != tap_receive)
|
|
Mark McLoughlin |
0c2ae8 |
+ return;
|
|
Mark McLoughlin |
0c2ae8 |
+
|
|
Mark McLoughlin |
0c2ae8 |
if (!s || !s->has_vnet_hdr)
|
|
Mark McLoughlin |
0c2ae8 |
return;
|
|
Mark McLoughlin |
0c2ae8 |
|
|
Mark McLoughlin |
0c2ae8 |
--
|
|
Mark McLoughlin |
0c2ae8 |
1.6.2.5
|
|
Mark McLoughlin |
0c2ae8 |
|