Skip to content

Commit

Permalink
Dont mirror the same packet again
Browse files Browse the repository at this point in the history
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
  • Loading branch information
divakardhar committed Feb 26, 2016
1 parent 16c05b7 commit c1c472c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dp-core/vr_mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c1c472c

Please sign in to comment.