aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2009-08-24 10:42:44 -0700
committerBen Pfaff <blp@nicira.com>2009-08-26 14:03:39 -0700
commit274de4d20f450cc4cf83500d806f8b361f1387a5 (patch)
treed60ff097e9aee0e6e6b7b2d39f992f26c185ef8a
parent5b4994cd75470b694628fb76eb0fb01869eaac9a (diff)
vswitchd: Avoid output port explosion with mirrors that output to VLANs.
compose_dsts() was updating the VLAN of packets sent to VLAN mirrors before it changed the VLAN value, but of course it's the final VLAN value that actually matters. Thanks to Reid for his good work tracking this one down. Bug #1898.
-rw-r--r--vswitchd/bridge.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 7ec774ac..3ffa671a 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1710,12 +1710,14 @@ compose_dsts(const struct bridge *br, const flow_t *flow, uint16_t vlan,
for (i = 0; i < br->n_ports; i++) {
struct port *port = br->ports[i];
if (port_includes_vlan(port, m->out_vlan)
- && set_dst(dst, flow, in_port, port, tags)
- && !dst_is_duplicate(dsts, dst - dsts, dst))
+ && set_dst(dst, flow, in_port, port, tags))
{
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) {
/* Don't send out input port on same VLAN. */