Make 'any' a reserved name for prefixlists
This commit is contained in:
@ -363,7 +363,7 @@ interfaces:
|
|||||||
|
|
||||||
This construct allows to enumerate a list of IPv4 or IPv6 host addresses and/or networks. Each
|
This construct allows to enumerate a list of IPv4 or IPv6 host addresses and/or networks. Each
|
||||||
prefixlist has a name which consists of anywhere between 1 and 56 characters, and it must start
|
prefixlist has a name which consists of anywhere between 1 and 56 characters, and it must start
|
||||||
with a letter. The syntax is straight forward:
|
with a letter. The prefixlist name `any` is reserved. The syntax is straight forward:
|
||||||
|
|
||||||
* ***description***: A string, no longer than 64 characters, and excluding the single quote '
|
* ***description***: A string, no longer than 64 characters, and excluding the single quote '
|
||||||
and double quote ". This string is currently not used anywhere, and serves for enduser
|
and double quote ". This string is currently not used anywhere, and serves for enduser
|
||||||
|
@ -113,6 +113,12 @@ def validate_prefixlists(yaml):
|
|||||||
|
|
||||||
for plname, pl in yaml["prefixlists"].items():
|
for plname, pl in yaml["prefixlists"].items():
|
||||||
logger.debug(f"prefixlist {plname}: {pl}")
|
logger.debug(f"prefixlist {plname}: {pl}")
|
||||||
|
if plname in ["any"]:
|
||||||
|
## Note: ACL 'source' and 'destination', when they are empty, will resolve
|
||||||
|
## to 'any', and can thus never refer to a prefixlist called 'any'.
|
||||||
|
msgs.append(f"prefixlist {plname} is a reserved name")
|
||||||
|
result = False
|
||||||
|
|
||||||
members = 0
|
members = 0
|
||||||
for pl_member in pl["members"]:
|
for pl_member in pl["members"]:
|
||||||
members += 1
|
members += 1
|
||||||
|
18
vppcfg/unittest/yaml/error-prefixlist1.yaml
Normal file
18
vppcfg/unittest/yaml/error-prefixlist1.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
test:
|
||||||
|
description: "Some prefixlist names are reserved"
|
||||||
|
errors:
|
||||||
|
expected:
|
||||||
|
- "prefixlist any is a reserved name"
|
||||||
|
count: 1
|
||||||
|
---
|
||||||
|
prefixlists:
|
||||||
|
any:
|
||||||
|
description: "any is a reserved name"
|
||||||
|
members:
|
||||||
|
- 192.0.2.1
|
||||||
|
- 192.0.2.0/24
|
||||||
|
v6only:
|
||||||
|
members:
|
||||||
|
- 2001:db8::1
|
||||||
|
- 2001:db8::/64
|
||||||
|
- 2001:db8::/48
|
Reference in New Issue
Block a user