diff options
author | 2025-04-24 04:22:38 +0000 | |
---|---|---|
committer | 2025-04-28 12:37:54 +0100 | |
commit | 5c3bf6cba7911f470afd748606be5c03a9512fcc (patch) | |
tree | 1bad8e0b042835bb7dc60df9f18bcb875d564ba3 /tools/perf/scripts/python/gecko.py | |
parent | Merge branch 'io_uring-zcrx-fix-selftests-and-add-new-test-for-rss-ctx' (diff) | |
download | wireguard-linux-5c3bf6cba7911f470afd748606be5c03a9512fcc.tar.xz wireguard-linux-5c3bf6cba7911f470afd748606be5c03a9512fcc.zip |
bonding: assign random address if device address is same as bond
This change addresses a MAC address conflict issue in failover scenarios,
similar to the problem described in commit a951bc1e6ba5 ("bonding: correct
the MAC address for 'follow' fail_over_mac policy").
In fail_over_mac=follow mode, the bonding driver expects the formerly active
slave to swap MAC addresses with the newly active slave during failover.
However, under certain conditions, two slaves may end up with the same MAC
address, which breaks this policy:
1) ip link set eth0 master bond0
-> bond0 adopts eth0's MAC address (MAC0).
2) ip link set eth1 master bond0
-> eth1 is added as a backup with its own MAC (MAC1).
3) ip link set eth0 nomaster
-> eth0 is released and restores its MAC (MAC0).
-> eth1 becomes the active slave, and bond0 assigns MAC0 to eth1.
4) ip link set eth0 master bond0
-> eth0 is re-added to bond0, now both eth0 and eth1 have MAC0.
This results in a MAC address conflict and violates the expected behavior
of the failover policy.
To fix this, we assign a random MAC address to any newly added slave if
its current MAC address matches that of the bond. The original (permanent)
MAC address is saved and will be restored when the device is released
from the bond.
This ensures that each slave has a unique MAC address during failover
transitions, preserving the integrity of the fail_over_mac=follow policy.
Fixes: 3915c1e8634a ("bonding: Add "follow" option to fail_over_mac")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions