summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-03 14:56:21 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-04 11:25:31 +0200
commit3fad8f2f74224502018c5e53b5931251595ad3b7 (patch)
treec38bd5ac0a83d10dac857206125b86ec2a0952c8 /src
parent6205c4d6701bda5f8a859291a5e152e009252301 (diff)
downloadvyos-1x-3fad8f2f74224502018c5e53b5931251595ad3b7.tar.gz
vyos-1x-3fad8f2f74224502018c5e53b5931251595ad3b7.zip
bonding: T1614: can not set primary interface when it's not part of the bond
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interface-bonding.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py
index 6cd8fdc56..b150578e3 100755
--- a/src/conf_mode/interface-bonding.py
+++ b/src/conf_mode/interface-bonding.py
@@ -302,6 +302,9 @@ def verify(bond):
if bond['mode'] not in ['active-backup', 'balance-tlb', 'balance-alb']:
raise ConfigError('Mode dependency failed, primary not supported in this mode.'.format())
+ if bond['primary'] not in bond['member']:
+ raise ConfigError('Interface "{}" is not part of the bond'.format(bond['primary']))
+
return None
def generate(bond):