aboutsummaryrefslogtreecommitdiff
path: root/lib/bond.c
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-04-12 15:15:32 -0700
committerEthan Jackson <ethan@nicira.com>2011-04-13 14:15:22 -0700
commitb3c18f66bfb1d6ef112716cbcfceb8aa5731ed4b (patch)
treeced44056560c0ffdd05c5c069f9abfcd9419ed04 /lib/bond.c
parent95aafb2a600075753da879d1284fe44ec886a365 (diff)
bond: Use bond_enable_slave at slave registration.
Slave registration should go through the normal slave enabling facilities instead of doing it by hand. Before this patch, newly created slaves would have no tag associated with them. Furthermore, any further changes to how slaves are enabled would not be picked up by the registration code.
Diffstat (limited to 'lib/bond.c')
-rw-r--r--lib/bond.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/bond.c b/lib/bond.c
index ee0e68c8..de71b9f1 100644
--- a/lib/bond.c
+++ b/lib/bond.c
@@ -357,7 +357,8 @@ bond_slave_register(struct bond *bond, void *slave_, struct netdev *netdev,
slave->aux = slave_;
slave->delay_expires = LLONG_MAX;
slave->up = bond_is_link_up(bond, netdev);
- slave->enabled = slave->up;
+ slave->enabled = false;
+ bond_enable_slave(slave, slave->up, NULL);
}
slave->netdev = netdev;
@@ -384,6 +385,8 @@ bond_slave_unregister(struct bond *bond, const void *slave_)
return;
}
+ bond_enable_slave(slave, false, NULL);
+
del_active = bond->active_slave == slave;
if (bond->hash) {
struct bond_entry *e;
@@ -1321,7 +1324,9 @@ bond_enable_slave(struct bond_slave *slave, bool enable, struct tag_set *tags)
slave->enabled = enable;
if (!slave->enabled) {
VLOG_WARN("interface %s: disabled", slave->name);
- tag_set_add(tags, slave->tag);
+ if (tags) {
+ tag_set_add(tags, slave->tag);
+ }
} else {
VLOG_WARN("interface %s: enabled", slave->name);
slave->tag = tag_create_random();