aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2014-01-25 00:00:57 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-04 22:47:27 -0500
commitcc689aaa7abf33b2ccb02482e5e17885ea8903d1 (patch)
tree57e07faeb8def276e9cb83446758ed1043d093d4 /drivers/net/bonding
parent00503b6f702eaf23e7257d6287da72805d7d014c (diff)
bonding: fail_over_mac should only affect AB mode in bond_set_mac_address()
The fail_over_mac could be set to active or follow in any time for all modes, so if the fail_over_mac is not none and the current mode is not active-backup, the bond_set_mac_address() could not change the master and slave's MAC address. In bond_set_mac_address(), the fail_over_mac should only affect AB mode, so modify to check the mode in addition to fail_over_mac when setting bond's MAC address. Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Veaceslav Falico <vfalico@redhat.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8e6dd13b3607..35f7e90aef72 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3439,7 +3439,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
3439 /* If fail_over_mac is enabled, do nothing and return success. 3439 /* If fail_over_mac is enabled, do nothing and return success.
3440 * Returning an error causes ifenslave to fail. 3440 * Returning an error causes ifenslave to fail.
3441 */ 3441 */
3442 if (bond->params.fail_over_mac) 3442 if (bond->params.fail_over_mac &&
3443 bond->params.mode == BOND_MODE_ACTIVEBACKUP)
3443 return 0; 3444 return 0;
3444 3445
3445 if (!is_valid_ether_addr(sa->sa_data)) 3446 if (!is_valid_ether_addr(sa->sa_data))