diff options
| author | Wesley Coakley <wcoakley@nvidia.com> | 2021-01-05 04:22:57 -0500 |
|---|---|---|
| committer | Wesley Coakley <wcoakley@nvidia.com> | 2021-01-06 07:18:20 -0500 |
| commit | c850908b9d036a80f25b4ee7331cffa5e3504874 (patch) | |
| tree | c09f580449ed82fbe70dc2914422e0de57991913 /tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py | |
| parent | a7f52fb0f7e0cdbb274ef447196da84f1bcf5a80 (diff) | |
bgpd: separate lcommunity validation from tokenizer
`lcommunity_gettoken` expects a space-delimeted list of 0 or more large
communities. `lcommunity_list_valid` can perform this check.
`lcommunity_list_valid` now validates large community lists more
accurately based on the following condition: Each quantity in a standard bgp
large community must:
1. Contain at least one digit
2. Fit within 4 octets
3. Contain only digits unless the lcommunity is "expanded"
4. Contain a valid regex if the lcommunity is "expanded"
Moreover we validate that each large community list contains exactly 3
such values separated by a single colon each.
One quirk of our validation which is worth documenting is:
```
bgp large-community-list standard test2 permit 1:c:3
bgp large-community-list expanded test1 permit 1:c:3
```
The first line will throw an error complaining about a "malformed community-list
value". The second line will be accepted because the each value is each treated as
a regex when matching large communities, it simply will never match anything so
it's rather useless.
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py')
0 files changed, 0 insertions, 0 deletions
