diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2006-09-22 21:56:15 -0700 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-25 20:08:09 -0400 |
commit | 8a8e447b2aa1f9139d0bfc94a2a3426be9c8d40a (patch) | |
tree | 154d0eae23c8a90f7c260e9dd513b0acb898828c /drivers/net/bonding/bond_main.c | |
parent | 89cc76f95af3608d83a1d70b3c76b71ffe66e1f7 (diff) |
[PATCH] bonding: Fix primary selection error at enslavement time
At enslavement time, the primary slave might not be activated if
there is already an active slave and the new slave is the primary.
Replaced complicated logic with a call to bond_select_active_slave(),
which does the right thing.
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=6378
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index fd521b05db8..0fb5f653d3c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1513,29 +1513,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) switch (bond->params.mode) { case BOND_MODE_ACTIVEBACKUP: - /* if we're in active-backup mode, we need one and - * only one active interface. The backup interfaces - * will have their SLAVE_INACTIVE flag set because we - * need them to be drop all packets. Thus, since we - * guarantee that curr_active_slave always point to - * the last usable interface, we just have to verify - * this interface's flag. - */ - if (((!bond->curr_active_slave) || - (bond->curr_active_slave->dev->priv_flags & IFF_SLAVE_INACTIVE)) && - (new_slave->link != BOND_LINK_DOWN)) { - /* first slave or no active slave yet, and this link - is OK, so make this interface the active one */ - bond_change_active_slave(bond, new_slave); - printk(KERN_INFO DRV_NAME - ": %s: first active interface up!\n", - bond->dev->name); - netif_carrier_on(bond->dev); - - } else { - dprintk("This is just a backup slave\n"); - bond_set_slave_inactive_flags(new_slave); - } + bond_set_slave_inactive_flags(new_slave); + bond_select_active_slave(bond); break; case BOND_MODE_8023AD: /* in 802.3ad mode, the internal mechanism |