summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-15 19:51:48 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-15 19:52:12 +0100
commiteab44d2757b67fa8801e9bb147ccacd01b081f7d (patch)
treed95eb5bf3cc6d2bc46afda7b7afde7fc32f4a00c /src/conf_mode
parent2300ff740dd63ed2486eada23917ff4440b6fc9f (diff)
downloadvyos-1x-eab44d2757b67fa8801e9bb147ccacd01b081f7d.tar.gz
vyos-1x-eab44d2757b67fa8801e9bb147ccacd01b081f7d.zip
bond: T2041: add missing consitency check on member interface existence
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-bonding.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py
index ac4f213ec..81574515f 100755
--- a/src/conf_mode/interfaces-bonding.py
+++ b/src/conf_mode/interfaces-bonding.py
@@ -283,6 +283,10 @@ def verify(bond):
conf = Config()
for intf in bond['member']:
+ # check if member interface is "real"
+ if intf not in interfaces():
+ raise ConfigError('interface {} does not exist!'.format(intf))
+
# a bonding member interface is only allowed to be assigned to one bond!
all_bonds = conf.list_nodes('interfaces bonding')
# We do not need to check our own bond