summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-08-12 15:21:59 +0100
committerGitHub <noreply@github.com>2025-08-12 15:21:59 +0100
commit33b13061b55a8dbf302dcfaed1cf89b3e0f12e63 (patch)
treedbcfbf63d70bd117b78839a948655298ea1256a2 /python
parent7b42041ec7035a822bede3df4abbacb683f6d314 (diff)
parent6ebb8cd26962b9840a912d5fb0ab2d891f7b00e2 (diff)
downloadvyos-1x-33b13061b55a8dbf302dcfaed1cf89b3e0f12e63.tar.gz
vyos-1x-33b13061b55a8dbf302dcfaed1cf89b3e0f12e63.zip
Merge pull request #4656 from c-po/bonding-T7571
bond: T7571: fix inconsistent MAC address behaviour
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/bond.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py
index 8a97243c5..ba31ae0c9 100644
--- a/python/vyos/ifconfig/bond.py
+++ b/python/vyos/ifconfig/bond.py
@@ -485,11 +485,25 @@ class BondIf(Interface):
# Add (enslave) interfaces to bond
value = dict_search('member.interface', config)
+ is_first = True
for interface in (value or []):
- # if we've come here we already verified the interface
- # does not have an addresses configured so just flush
- # any remaining ones
- Interface(interface).flush_addrs()
+ # Physical bond member interface instance
+ tmp_if = Interface(interface)
+ # At this point, we've confirmed that the interface has no
+ # configured addresses, so we can safely flush any remaining ones.
+ tmp_if.flush_addrs()
+
+ # T7571: This behavior changed from Linux Kernel 5.4 (used in VyOS 1.3)
+ # to Kernel 6.6 (starting with VyOS 1.4). Previously, the MAC address of
+ # the first member interface in a bond was adopted as the bond's default MAC.
+ # In newer versions, a synthetic MAC address is assigned instead.
+ #
+ # Re-assign first underlay MAC address to the bond
+ if is_first:
+ self.set_mac(tmp_if.get_mac())
+ is_first = False
+
+ # Assign underlaying interface to logical bond
self.add_port(interface)
# Add system mac address for 802.3ad - default address is all zero