summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-07-12 18:12:54 +0100
committerGitHub <noreply@github.com>2022-07-12 18:12:54 +0100
commit02104b8cb194ac4034ff60663523620bc3eaf01e (patch)
tree949ed182d482e01647cee34e316e95d8c6d8cc1a
parent464af891335e14de3a9a76597da99d7e3543e7f2 (diff)
parent70f42e308a6d5b671b78762048182e7e38fdb715 (diff)
downloadvyos-1x-02104b8cb194ac4034ff60663523620bc3eaf01e.tar.gz
vyos-1x-02104b8cb194ac4034ff60663523620bc3eaf01e.zip
Merge pull request #1410 from sever-sever/T4527-eq
vrf: T4527: Prevent to create VRF with reserved names
-rwxr-xr-xsrc/conf_mode/vrf.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index fb2182fff..def4cc70d 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -108,8 +108,14 @@ def verify(vrf):
f'static routes installed!')
if 'name' in vrf:
+ reserved_names = ["add", "all", "broadcast", "default", "delete", "dev", "get", "inet", "mtu", "link", "type",
+ "vrf"]
table_ids = []
for name, config in vrf['name'].items():
+ # Reserved VRF names
+ if name in reserved_names:
+ raise ConfigError(f'VRF name "{name}" is reserved and connot be used!')
+
# table id is mandatory
if 'table' not in config:
raise ConfigError(f'VRF "{name}" table id is mandatory!')