bonding: set fail_over_mac to active only in active-backup mode at enslavement
Subsystems (3)
PATCH 4/5 bonding: set fail_over_mac to active only in active-backup mode at enslavement
The fail_over_mac only affect active-backup mode, if the first slave does not support setting the MAC address, we should set fail_over_mac to active only in active-backup mode, otherwise the bonding could not set all slaves to the master's address for other modes.
Signed-off-by Ding Tianhong <[email protected]>
--- drivers/net/bonding/bond_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +2 -1
@@ -1336,7 +1336,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)if (!bond_has_slaves (bond)) {pr_warning ("%s: Warning: The first slave device specified does not support setting the MAC address. Setting fail_over_mac to active." , bond_dev->name); - bond->params.fail_over_mac =BOND_FOM_ACTIVE ; +if (bond->params.mode ==BOND_MODE_ACTIVEBACKUP ) + bond->params.fail_over_mac =BOND_FOM_ACTIVE ; }else if (bond->params.fail_over_mac !=BOND_FOM_ACTIVE ) {pr_err ("%s: Error: The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active.\n" , bond_dev->name);
Signature · 1 line
1.8.0