From: Mark McLoughlin <[email protected]> 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 <[email protected]> Signed-off-by: Avi Kivity <[email protected]> diff --git a/net.c b/net.c index c47f6fa..281b0d2 100644 --- a/net.c +++ b/net.c @@ -1492,6 +1492,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; } @@ -1500,6 +1503,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; -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
