diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-12-19 21:19:11 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-12-19 21:51:39 +0100 |
| commit | 066d2be8b3d57b2171aa2056c7d953810f50dcb8 (patch) | |
| tree | 088ed4555d328145fab06a0d5134f7f29bf15b52 /src | |
| parent | ba60266ab18969d588179b3acff3bccc078b2ee8 (diff) | |
| download | vyos-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 'src')
| -rwxr-xr-x | src/conf_mode/interfaces_bonding.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces_bonding.py b/src/conf_mode/interfaces_bonding.py index 3f6450076..e6aaa3440 100755 --- a/src/conf_mode/interfaces_bonding.py +++ b/src/conf_mode/interfaces_bonding.py @@ -30,6 +30,7 @@ from vyos.configverify import verify_mirror_redirect from vyos.configverify import verify_mtu_ipv6 from vyos.configverify import verify_vlan_config from vyos.configverify import verify_vrf +from vyos.ethtool import Ethtool from vyos.frrender import FRRender from vyos.frrender import get_frrender_dict from vyos.ifconfig import BondIf @@ -251,6 +252,10 @@ def verify(bond): raise ConfigError('Configured MTU is less then member '\ f'interface "{interface}" minimum of {min_mtu}!') + # not all ethernet drivers support interface bonding + if not Ethtool(interface).check_bonding(): + raise ConfigError(error_msg + 'driver is not supported!') + if 'primary' in bond: if bond['primary'] not in bond['member']['interface']: raise ConfigError(f'Primary interface of bond "{bond_name}" must be a member interface') |
