diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2006-09-23 00:56:15 -0400 |
---|---|---|
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 fd521b05db83..0fb5f653d3ce 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) | |||
1513 | 1513 | ||
1514 | switch (bond->params.mode) { | 1514 | switch (bond->params.mode) { |
1515 | case BOND_MODE_ACTIVEBACKUP: | 1515 | case BOND_MODE_ACTIVEBACKUP: |
1516 | /* if we're in active-backup mode, we need one and | 1516 | bond_set_slave_inactive_flags(new_slave); |
1517 | * only one active interface. The backup interfaces | 1517 | bond_select_active_slave(bond); |
1518 | * will have their SLAVE_INACTIVE flag set because we | ||
1519 | * need them to be drop all packets. Thus, since we | ||
1520 | * guarantee that curr_active_slave always point to | ||
1521 | * the last usable interface, we just have to verify | ||
1522 | * this interface's flag. | ||
1523 | */ | ||
1524 | if (((!bond->curr_active_slave) || | ||
1525 | (bond->curr_active_slave->dev->priv_flags & IFF_SLAVE_INACTIVE)) && | ||
1526 | (new_slave->link != BOND_LINK_DOWN)) { | ||
1527 | /* first slave or no active slave yet, and this link | ||
1528 | is OK, so make this interface the active one */ | ||
1529 | bond_change_active_slave(bond, new_slave); | ||
1530 | printk(KERN_INFO DRV_NAME | ||
1531 | ": %s: first active interface up!\n", | ||
1532 | bond->dev->name); | ||
1533 | netif_carrier_on(bond->dev); | ||
1534 | |||
1535 | } else { | ||
1536 | dprintk("This is just a backup slave\n"); | ||
1537 | bond_set_slave_inactive_flags(new_slave); | ||
1538 | } | ||
1539 | break; | 1518 | break; |
1540 | case BOND_MODE_8023AD: | 1519 | case BOND_MODE_8023AD: |
1541 | /* in 802.3ad mode, the internal mechanism | 1520 | /* in 802.3ad mode, the internal mechanism |