From c1c472caf7209d3fd117d3d58c4d42dab7210505 Mon Sep 17 00:00:00 2001 From: Divakar Date: Fri, 26 Feb 2016 11:21:58 +0530 Subject: [PATCH] Dont mirror the same packet again If mirroring is enabled on analyzing VM's port itself, one copy of the original packet gets mirrored to that port. But this mirrored packet should not be mirroed again. Right now without verifying whether the packet is mirrored or not, it is attempted for mirroring again. When a packet is mirrored it is marked with flag VP_FLAG_FROM_DP. If this flag is set it is not mirrored again. Change-Id: Ie4cca916945878b77bc4db7666992f3933db3e13 closes-bug: #1549761 --- dp-core/vr_mirror.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dp-core/vr_mirror.c b/dp-core/vr_mirror.c index 7a16cc165..97c1df3b1 100644 --- a/dp-core/vr_mirror.c +++ b/dp-core/vr_mirror.c @@ -380,6 +380,10 @@ vr_mirror(struct vrouter *router, uint8_t mirror_id, struct vr_nexthop *pkt_nh; bool reset; + /* If the packet is already mirrored, dont mirror again */ + if (pkt->vp_flags & VP_FLAG_FROM_DP) + return 0; + mirror = router->vr_mirrors[mirror_id]; if (!mirror) return 0;