summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-12-19 21:19:11 +0100
committerChristian Breunig <christian@breunig.cc>2025-12-19 21:51:39 +0100
commit066d2be8b3d57b2171aa2056c7d953810f50dcb8 (patch)
tree088ed4555d328145fab06a0d5134f7f29bf15b52 /python
parentba60266ab18969d588179b3acff3bccc078b2ee8 (diff)
downloadvyos-1x-066d2be8b3d57b2171aa2056c7d953810f50dcb8.tar.gz
vyos-1x-066d2be8b3d57b2171aa2056c7d953810f50dcb8.zip
bond: T8084: disallow bond members that do not support MAC changes
Building on commit ba60266ab1896 (“ethernet: T8084: prevent MAC changes on ENA interfaces (AWS EC2)”), add safeguards to prevent interfaces from being used as bond members if they: * do not support MAC address changes, or * appear on a denylist of interfaces invalid for bonding (currently empty)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ethtool.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py
index 76c5b29f0..d0495df43 100644
--- a/python/vyos/ethtool.py
+++ b/python/vyos/ethtool.py
@@ -28,6 +28,7 @@ _drivers_without_speed_duplex_flow = ['vmxnet3', 'virtio_net', 'xen_netfront',
_drivers_without_mac_change = ['ena']
# enable interface bonding will change the interface MAC address, thus all drivers
# not supporting MAC address change, also do not support bonding
+_drivers_without_bonding_support = _drivers_without_mac_change + []
class Ethtool:
"""
@@ -230,3 +231,7 @@ class Ethtool:
def check_mac_change(self) -> bool:
""" Check if ethernet drivers supports changing MAC address """
return bool(self.get_driver_name() not in _drivers_without_mac_change)
+
+ def check_bonding(self) -> bool:
+ """ Check if ethernet drivers supports bonding """
+ return bool(self.get_driver_name() not in _drivers_without_bonding_support)