From 0c8185aea2ede0bac881d96bb0818389966d1c26 Mon Sep 17 00:00:00 2001 From: "Anand H. Krishnan" Date: Thu, 11 Feb 2016 08:54:19 +0530 Subject: [PATCH] Do not do a 'preset' on mirror packets When a packet comes from vhost, we typically accept the layer 2 header that is supplied by the host and hence a 'preset' is done to reset the packet to what it was before it entered vRouter. Unfortunately, this was also done for packets those mirrored such packets, leading to offset issues since we do end up adding a lot more headers than what the original packets contain. This leads to wrong length calculation and hence searching for more skbs than that is originally present and a crash. Change-Id: I906e7e3417c84ad567cf4b822187929b2a609b68 Closes-BUG: #1543534 --- dp-core/vr_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dp-core/vr_interface.c b/dp-core/vr_interface.c index 8e55e2caa..bd4ba9998 100644 --- a/dp-core/vr_interface.c +++ b/dp-core/vr_interface.c @@ -984,7 +984,8 @@ eth_set_rewrite(struct vr_interface *vif, struct vr_packet *pkt, if (!len) return pkt_data(pkt); - if (pkt->vp_if->vif_type == VIF_TYPE_HOST) { + if ((pkt->vp_if->vif_type == VIF_TYPE_HOST) && + !(pkt->vp_flags & VP_FLAG_FROM_DP)) { vr_preset(pkt); return pkt_data(pkt); }