Commit acd2c570 authored by Amir Noam's avatar Amir Noam Committed by Stephen Hemminger

[bonding 2.6] fix change active command

parent b382dfd2
...@@ -1720,20 +1720,29 @@ static int bond_change_active(struct net_device *master_dev, struct net_device * ...@@ -1720,20 +1720,29 @@ static int bond_change_active(struct net_device *master_dev, struct net_device *
} }
} }
/*
* Changing to the current active: do nothing; return success.
*/
if (newactive && (newactive == oldactive)) {
write_unlock_bh(&bond->lock);
return 0;
}
if ((newactive != NULL)&& if ((newactive != NULL)&&
(oldactive != NULL)&& (oldactive != NULL)&&
(newactive != oldactive)&&
(newactive->link == BOND_LINK_UP)&& (newactive->link == BOND_LINK_UP)&&
IS_UP(newactive->dev)) { IS_UP(newactive->dev)) {
if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
bond_set_slave_inactive_flags(oldactive); bond_set_slave_inactive_flags(oldactive);
bond_set_slave_active_flags(newactive); bond_set_slave_active_flags(newactive);
}
bond_mc_update(bond, newactive, oldactive); bond_mc_update(bond, newactive, oldactive);
bond_assign_current_slave(bond, newactive); bond_assign_current_slave(bond, newactive);
printk("%s : activate %s(old : %s)\n", printk("%s : activate %s(old : %s)\n",
master_dev->name, newactive->dev->name, master_dev->name, newactive->dev->name,
oldactive->dev->name); oldactive->dev->name);
} } else {
else {
ret = -EINVAL; ret = -EINVAL;
} }
write_unlock_bh(&bond->lock); write_unlock_bh(&bond->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment