From: Ben Pfaff Date: Mon, 24 Aug 2009 17:42:44 +0000 (-0700) Subject: vswitchd: Avoid output port explosion with mirrors that output to VLANs. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=274de4d20f450cc4cf83500d806f8b361f1387a5;p=openvswitch 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. --- 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. */