From: Ethan Jackson Date: Tue, 12 Apr 2011 22:15:32 +0000 (-0700) Subject: bond: Use bond_enable_slave at slave registration. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3c18f66bfb1d6ef112716cbcfceb8aa5731ed4b;p=openvswitch 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. --- 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();