static void
bridge_reconfigure_one(struct bridge *br)
{
- struct svec old_ports, new_ports;
+ struct svec old_ports, new_ports, ifaces;
const char *controller;
+ size_t i, j;
char *ctl;
- size_t i;
/* Collect old and new ports. */
svec_init(&old_ports);
port_reconfigure(br->ports[i]);
}
+ /* Check and delete duplicate interfaces. */
+ svec_init(&ifaces);
+ for (i = 0; i < br->n_ports; ) {
+ struct port *port = br->ports[i];
+ for (j = 0; j < port->n_ifaces; ) {
+ struct iface *iface = port->ifaces[j];
+ if (svec_contains(&ifaces, iface->name)) {
+ VLOG_ERR("bridge %s: %s interface is on multiple ports, "
+ "removing from %s",
+ br->name, iface->name, port->name);
+ iface_destroy(iface);
+ } else {
+ svec_add(&ifaces, iface->name);
+ svec_sort(&ifaces);
+ j++;
+ }
+ }
+ if (!port->n_ifaces) {
+ VLOG_ERR("%s port has no interfaces, dropping", port->name);
+ port_destroy(port);
+ } else {
+ i++;
+ }
+ }
+
/* Configure remote controller. */
controller = cfg_get_string(0, "bridge.%s.controller", br->name);
ctl = controller ? xstrdup(controller) : NULL;