port->port_idx = br->n_ports;
port->vlan = 0;
port->name = xstrdup(name);
+ port->active_iface = -1;
if (br->n_ports >= br->allocated_ports) {
br->ports = x2nrealloc(br->ports, &br->allocated_ports,
e->iface_idx = -1;
e->tx_bytes = 0;
}
- bond_choose_active_iface(port);
port->no_ifaces_tag = tag_create_random();
+ bond_choose_active_iface(port);
}
}
}
{
if (iface) {
struct port *port = iface->port;
+ bool del_active = port->active_iface == iface->port_ifidx;
struct iface *del;
del = port->ifaces[iface->port_ifidx] = port->ifaces[--port->n_ifaces];
free(iface->name);
free(iface);
+ if (del_active) {
+ tag_set_add(&port->bridge->revalidate_set, port->active_iface_tag);
+ bond_choose_active_iface(port);
+ }
+
port_update_bonding(port);
bridge_flush(port->bridge);
}