The code was careless about updating the netdev_monitor. Newly added
slaves weren't added to the monitor until the next bond_reconfigure() call,
and netdevs were never removed from the monitor.
bond->bond_revalidate = true;
}
- slave->netdev = netdev;
+ if (slave->netdev != netdev) {
+ if (bond->monitor) {
+ if (slave->netdev) {
+ netdev_monitor_remove(bond->monitor, slave->netdev);
+ }
+ netdev_monitor_add(bond->monitor, netdev);
+ }
+ slave->netdev = netdev;
+ }
+
free(slave->name);
slave->name = xstrdup(netdev_get_name(netdev));
}
return;
}
+ if (bond->monitor) {
+ netdev_monitor_remove(bond->monitor, slave->netdev);
+ }
+
bond_enable_slave(slave, false, NULL);
del_active = bond->active_slave == slave;