[ovs-dev] [PATCH] mirroring: Fix check to avoid outputing to input port.

Jesse Gross jesse at nicira.com
Thu Oct 8 02:45:08 UTC 2009


When RSPANing with a bond, ensure that we don't receive a packet on
one interface and then output it on the other interface of the bond.
Also avoid sending the packet out the same interface it was received
on when an interfaced is configured with the VLAN that we are using
for RSPAN.

Bug #2118
---
 vswitchd/bridge.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index f32d2ba..270e937 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1715,14 +1715,20 @@ compose_dsts(const struct bridge *br, const flow_t *flow, uint16_t vlan,
                     if (port_includes_vlan(port, m->out_vlan)
                         && set_dst(dst, flow, in_port, port, tags))
                     {
+                        int flow_vlan;
+
                         if (port->vlan < 0) {
                             dst->vlan = m->out_vlan;
                         }
                         if (dst_is_duplicate(dsts, dst - dsts, dst)) {
                             continue;
                         }
-                        if (dst->dp_ifidx == flow->in_port
-                            && dst->vlan == vlan) {
+
+                        flow_vlan = ntohs(flow->dl_vlan);
+                        if (flow_vlan == 0) {
+                            flow_vlan = OFP_VLAN_NONE;
+                        }
+                        if (port == in_port && dst->vlan == flow_vlan) {
                             /* Don't send out input port on same VLAN. */
                             continue;
                         }
-- 
1.6.0.4





More information about the dev mailing list