Skip to content

Commit 032ed89

Browse files
liuhangbinopsiff
authored andcommitted
bonding: report duplicate MAC address in all situations
[ Upstream commit 28d68d3 ] Normally, a bond uses the MAC address of the first added slave as the bond’s MAC address. And the bond will set active slave’s MAC address to bond’s address if fail_over_mac is set to none (0) or follow (2). When the first slave is removed, the bond will still use the removed slave’s MAC address, which can lead to a duplicate MAC address and potentially cause issues with the switch. To avoid confusion, let's warn the user in all situations, including when fail_over_mac is set to 2 or not in active-backup mode. Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20250225033914.18617-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit fed3038a80bbcbf89cbc7436348a70095214b331)
1 parent 72019f8 commit 032ed89

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2469,7 +2469,7 @@ static int __bond_release_one(struct net_device *bond_dev,
24692469

24702470
RCU_INIT_POINTER(bond->current_arp_slave, NULL);
24712471

2472-
if (!all && (!bond->params.fail_over_mac ||
2472+
if (!all && (bond->params.fail_over_mac != BOND_FOM_ACTIVE ||
24732473
BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)) {
24742474
if (ether_addr_equal_64bits(bond_dev->dev_addr, slave->perm_hwaddr) &&
24752475
bond_has_slaves(bond))

0 commit comments

Comments
 (0)