Commit 709f8a45 authored by Or Gerlitz's avatar Or Gerlitz Committed by Jeff Garzik

bonding: bond_change_active_slave() cleanup under active-backup

simplified the code of bond_change_active_slave() such that under
active-backup mode there's one "if (new_active)" test and the rest
of the code only does extra checks on top of it. This removed an
unneeded "if (bond->send_grat_arp > 0)" check and avoid calling
bond_send_gratuitous_arp when there's no active slave.

Jay Vosburgh made minor coding style changes to the orignal patch.
Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent c1da4ac7
...@@ -1189,21 +1189,19 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) ...@@ -1189,21 +1189,19 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
if (new_active) { if (new_active) {
bond_set_slave_active_flags(new_active); bond_set_slave_active_flags(new_active);
}
if (new_active && bond->params.fail_over_mac) if (bond->params.fail_over_mac)
bond_do_fail_over_mac(bond, new_active, old_active); bond_do_fail_over_mac(bond, new_active,
old_active);
bond->send_grat_arp = bond->params.num_grat_arp; bond->send_grat_arp = bond->params.num_grat_arp;
if (bond->curr_active_slave && if (!test_bit(__LINK_STATE_LINKWATCH_PENDING,
test_bit(__LINK_STATE_LINKWATCH_PENDING,
&bond->curr_active_slave->dev->state)) { &bond->curr_active_slave->dev->state)) {
dprintk("delaying gratuitous arp on %s\n",
bond->curr_active_slave->dev->name);
} else {
if (bond->send_grat_arp > 0) {
bond_send_gratuitous_arp(bond); bond_send_gratuitous_arp(bond);
bond->send_grat_arp--; bond->send_grat_arp--;
} else {
dprintk("delaying gratuitous arp on %s\n",
bond->curr_active_slave->dev->name);
} }
} }
} }
......
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