Răsfoiți Sursa

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>
dingtianhong 11 ani în urmă
părinte
comite
cc689aaa7a
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      drivers/net/bonding/bond_main.c

+ 2 - 1
drivers/net/bonding/bond_main.c

@@ -3439,7 +3439,8 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
 	/* If fail_over_mac is enabled, do nothing and return success.
 	/* If fail_over_mac is enabled, do nothing and return success.
 	 * Returning an error causes ifenslave to fail.
 	 * Returning an error causes ifenslave to fail.
 	 */
 	 */
-	if (bond->params.fail_over_mac)
+	if (bond->params.fail_over_mac &&
+	    bond->params.mode == BOND_MODE_ACTIVEBACKUP)
 		return 0;
 		return 0;
 
 
 	if (!is_valid_ether_addr(sa->sa_data))
 	if (!is_valid_ether_addr(sa->sa_data))