diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-09-04 16:22:15 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-09-04 16:28:18 +0200 |
commit | 053f208b2ed9477fc70b770ab7ac884109d9a89a (patch) | |
tree | fe69459b75b7838e79de9b881dbfdae6d2d03fa8 /src/conf_mode/interface-bridge.py | |
parent | 07ebd7589a961aaa8d4f3099836dd94e4bce2379 (diff) | |
download | vyos-1x-053f208b2ed9477fc70b770ab7ac884109d9a89a.tar.gz vyos-1x-053f208b2ed9477fc70b770ab7ac884109d9a89a.zip |
bridge: T1615: can not add member interface to bridge if it is also part of a bond
Diffstat (limited to 'src/conf_mode/interface-bridge.py')
-rwxr-xr-x | src/conf_mode/interface-bridge.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py index 6e48a1382..1d3587114 100755 --- a/src/conf_mode/interface-bridge.py +++ b/src/conf_mode/interface-bridge.py @@ -172,6 +172,13 @@ def verify(bridge): if intf['name'] not in interfaces(): raise ConfigError('Can not add non existing interface "{}" to bridge "{}"'.format(intf['name'], bridge['intf'])) + # bridge members are not allowed to be bond members, too + for intf in bridge['member']: + for bond in conf.list_nodes('interfaces bonding'): + if conf.exists('interfaces bonding ' + bond + ' member interface'): + if intf['name'] in conf.return_values('interfaces bonding ' + bond + ' member interface'): + raise ConfigError('Interface {} belongs to bond {}, can not add it to {}'.format(intf['name'], bond, bridge['intf'])) + return None def generate(bridge): |