summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-bridge.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-04 16:30:20 +0200
committerGitHub <noreply@github.com>2019-09-04 16:30:20 +0200
commit62abfc2653e5206f1af95163909e5f924002b499 (patch)
tree8102bab9334abc886469dd9e45d647f938984275 /src/conf_mode/interface-bridge.py
parent65dd56453b451377f10c664b3baf925c4ff62756 (diff)
parent053f208b2ed9477fc70b770ab7ac884109d9a89a (diff)
downloadvyos-1x-62abfc2653e5206f1af95163909e5f924002b499.tar.gz
vyos-1x-62abfc2653e5206f1af95163909e5f924002b499.zip
Merge pull request #124 from c-po/t1614-bonding
T1614 bonding
Diffstat (limited to 'src/conf_mode/interface-bridge.py')
-rwxr-xr-xsrc/conf_mode/interface-bridge.py7
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):