diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-09 18:42:24 +0000 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-09-09 18:42:24 +0000 |
| commit | 395338fe0692b4ecf8547ab5cf18dd147e07902d (patch) | |
| tree | 9b59af2d285a3314fe731b5e802518b64e2cd2e4 /python | |
| parent | 438463db0d290e58cb733893478cdb4537d922f8 (diff) | |
| download | vyos-1x-395338fe0692b4ecf8547ab5cf18dd147e07902d.tar.gz vyos-1x-395338fe0692b4ecf8547ab5cf18dd147e07902d.zip | |
bond: T9269: keep the bond MAC when appending a member interface
Commit 6ebb8cd26 ("bond: T7571: fix inconsistent MAC address behaviour")
re-assigns the first member's MAC address to the bond, as newer Kernels
no longer do so themselves. The flag driving it was initialized
unconditionally and an already enslaved member hits "continue" without
clearing it, so the step ran again on every append and handed the bond
the newly added member's address:
bond0 aa:c1:ab:c3:62:48
eth1 aa:c1:ab:98:48:0f
eth2 aa:c1:ab:c3:62:48
Only adopt a member MAC while the bond has no member at all, which is
what T7571 intended.
The added smoketest covers this together with T9269 in leaf_node_changed:
it commits one member, appends a second, and verifies both stay enslaved,
the pre-existing member stays admin up, and the bond MAC does not move.
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/ifconfig/bond.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py index 5171f12ab..3b81801c3 100644 --- a/python/vyos/ifconfig/bond.py +++ b/python/vyos/ifconfig/bond.py @@ -481,7 +481,9 @@ class BondIf(Interface): # Add new interfaces to the bond first before removing no longer # required members - this is to ensure that in theory there is always an # active member link - is_first = True + # T7571: Kernel 6.6 assigns a synthetic MAC instead of the first + # member's - adopt it ourselves, but only on an empty bond + adopt_member_mac = not bond_members for interface in dict_search('member.interface', config, default=[]): # Only add interface to bond if it is not already a member if interface in bond_members: @@ -493,15 +495,9 @@ class BondIf(Interface): # 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: + if adopt_member_mac: self.set_mac(tmp_if.get_mac()) - is_first = False + adopt_member_mac = False # Assign underlying interface to logical bond self.add_port(interface) |
