summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-06 10:41:55 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-06 10:41:55 +0200
commit96e0f5697b181be4f2f3c5c763821ef574881a93 (patch)
treec261af3a4fede58601d58eb7ca29b71c4e294397 /src
parent7e681c180de8adceb6beb216e194c09ad4d3107c (diff)
downloadvyos-1x-96e0f5697b181be4f2f3c5c763821ef574881a93.tar.gz
vyos-1x-96e0f5697b181be4f2f3c5c763821ef574881a93.zip
bonding: T1614: enslaved interfaces can be added to only one bond at a time
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interface-bonding.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py
index 81667289d..7b86a0528 100755
--- a/src/conf_mode/interface-bonding.py
+++ b/src/conf_mode/interface-bonding.py
@@ -270,6 +270,12 @@ def verify(bond):
conf = Config()
for intf in bond['member']:
+ # a bond member is only allowed to be assigned to any one bond
+ for tmp in conf.list_nodes('interfaces bonding'):
+ if conf.exists('interfaces bonding ' + tmp + ' member interface ' + intf):
+ raise ConfigError('can not add interface {} that is part of another bond ({}) to {}'.format(
+ intf, tmp, bond['intf']))
+
# we can not add disabled slave interfaces to our bond
if conf.exists('interfaces ethernet ' + intf + ' disable'):
raise ConfigError('can not add disabled interface {} to {}'.format(intf, bond['intf']))