summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-10 17:26:11 +0200
committerGitHub <noreply@github.com>2026-09-10 17:26:11 +0200
commit148dd2b2f5ac5f0cd3671650aa11100fc293b588 (patch)
treecbcfc483d4699314b411ebb99448363051aab0c0 /python
parentb656e77a1c9a206edf35c361f4fcb1940cd5be91 (diff)
parentaa3f1c548198a1110d67385f19ccc910c5c48be8 (diff)
downloadvyos-1x-148dd2b2f5ac5f0cd3671650aa11100fc293b588.tar.gz
vyos-1x-148dd2b2f5ac5f0cd3671650aa11100fc293b588.zip
Merge pull request #5454 from c-po/bond-fix-add-member
bond: T9269: keep the bond MAC when appending a member interface
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py7
-rw-r--r--python/vyos/ifconfig/bond.py14
2 files changed, 11 insertions, 10 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index ff784251a..da2e9792c 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -133,8 +133,13 @@ def leaf_node_changed(conf, path):
return True
if old is None:
return []
+ # A multi node holding a single value is a plain string in the JSON
+ # rendering of the config tree, and only becomes a list once it holds
+ # several values. Normalize before diffing, else appending a value to a
+ # single-valued multi node reports the already configured value as gone
+ # just because its representation changed from string to list
if isinstance(old, str):
- return [old]
+ old = [old]
if isinstance(old, list):
if isinstance(new, str):
new = [new]
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)