git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bond: Be more careful about adding and removing netdevs in the monitor.
[sliver-openvswitch.git]
/
lib
/
bond.c
diff --git
a/lib/bond.c
b/lib/bond.c
index
4d7d05a
..
ed6ed89
100644
(file)
--- a/
lib/bond.c
+++ b/
lib/bond.c
@@
-369,7
+369,16
@@
bond_slave_register(struct bond *bond, void *slave_, uint16_t stb_id,
bond->bond_revalidate = true;
}
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));
}
free(slave->name);
slave->name = xstrdup(netdev_get_name(netdev));
}
@@
-388,6
+397,10
@@
bond_slave_unregister(struct bond *bond, const void *slave_)
return;
}
return;
}
+ if (bond->monitor) {
+ netdev_monitor_remove(bond->monitor, slave->netdev);
+ }
+
bond_enable_slave(slave, false, NULL);
del_active = bond->active_slave == slave;
bond_enable_slave(slave, false, NULL);
del_active = bond->active_slave == slave;