summaryrefslogtreecommitdiff
path: root/src/validators/vrf-name
diff options
context:
space:
mode:
authorRunar Borge <runar@borge.nu>2020-04-03 14:53:38 +0200
committerRunar Borge <runar@borge.nu>2020-04-03 14:53:38 +0200
commit68b4090f3ee1e313ae6beb590608f257687e03f2 (patch)
tree9bf7cb6c6964dd5a54e1fa5fe1af60dd09d20344 /src/validators/vrf-name
parent72d0d8768f03ce78dff29404e1e73ee39ff2fc39 (diff)
downloadvyos-1x-68b4090f3ee1e313ae6beb590608f257687e03f2.tar.gz
vyos-1x-68b4090f3ee1e313ae6beb590608f257687e03f2.zip
vrf: T31: Allow vrf name to look more like interface name
Fix the regex to allow vrf instances like "eth0vrf" but not to allow "eth0"
Diffstat (limited to 'src/validators/vrf-name')
-rwxr-xr-xsrc/validators/vrf-name2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validators/vrf-name b/src/validators/vrf-name
index b1a2527d8..11c453f4d 100755
--- a/src/validators/vrf-name
+++ b/src/validators/vrf-name
@@ -33,7 +33,7 @@ if len(argv) == 2:
# VRF instances should not be named after regular interface names like bond0,
# br10 and so on - this can cause a lot of confusion/trouble
pattern = "^(?!(bond|br|dum|eth|lan|eno|ens|enp|enx|gnv|ipoe|l2tp|l2tpeth|" \
- "vtun|ppp|pppoe|peth|tun|vti|vxlan|wg|wlan|wlm)[0-9]+).*$"
+ "vtun|ppp|pppoe|peth|tun|vti|vxlan|wg|wlan|wlm)\d+(\.\d+(v.+)?)?$).*$"
if re.match(pattern, argv[1]):
exit(0)