return error;
}
+/* Checks if 'ofproto' thinks 'odp_port' should be included in floods. Returns
+ * true if 'odp_port' exists and should be included, false otherwise. */
+bool
+ofproto_port_is_floodable(struct ofproto *ofproto, uint16_t odp_port)
+{
+ struct ofport *ofport = get_port(ofproto, odp_port);
+ return ofport && !(ofport->opp.config & OFPPC_NO_FLOOD);
+}
+
int
ofproto_send_packet(struct ofproto *p, const struct flow *flow,
const union ofp_action *actions, size_t n_actions,
bool ofproto_is_alive(const struct ofproto *);
int ofproto_port_del(struct ofproto *, uint16_t odp_port);
+bool ofproto_port_is_floodable(struct ofproto *, uint16_t odp_port);
/* Configuration. */
void ofproto_set_datapath_id(struct ofproto *, uint64_t datapath_id);
return vlan == port->vlan || port_trunks_vlan(port, vlan);
}
+static bool
+port_is_floodable(const struct port *port)
+{
+ int i;
+
+ for (i = 0; i < port->n_ifaces; i++) {
+ if (!ofproto_port_is_floodable(port->bridge->ofproto,
+ port->ifaces[i]->dp_ifidx)) {
+ return false;
+ }
+ }
+ return true;
+}
+
static size_t
compose_dsts(const struct bridge *br, const struct flow *flow, uint16_t vlan,
const struct port *in_port, const struct port *out_port,
/* XXX even better, define each VLAN as a datapath port group */
for (i = 0; i < br->n_ports; i++) {
struct port *port = br->ports[i];
- if (port != in_port && port_includes_vlan(port, vlan)
+ if (port != in_port
+ && port_is_floodable(port)
+ && port_includes_vlan(port, vlan)
&& !port->is_mirror_output_port
&& set_dst(dst, flow, in_port, port, tags)) {
mirrors |= port->dst_mirrors;