From 274de4d20f450cc4cf83500d806f8b361f1387a5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 24 Aug 2009 10:42:44 -0700 Subject: [PATCH] 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. --- vswitchd/bridge.c | 6 ++++-- 1 file 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. */ -- 2.30.2