diff options
author | Cheeze_It <none@none.com> | 2024-01-09 18:18:26 -0700 |
---|---|---|
committer | Cheeze_It <none@none.com> | 2024-01-09 18:18:26 -0700 |
commit | cfb5b052c84ffba789d61a59350676b6b4a0a5f7 (patch) | |
tree | 7520d06dbc168b964bf5e3f5aeec86a129339ce6 /src/conf_mode/protocols_isis.py | |
parent | 10f6eac581ba46a0c235ae7c97541c7094567e70 (diff) | |
download | vyos-1x-cfb5b052c84ffba789d61a59350676b6b4a0a5f7.tar.gz vyos-1x-cfb5b052c84ffba789d61a59350676b6b4a0a5f7.zip |
T5916: Added segment routing check for index base size and SRGB base size
Diffstat (limited to 'src/conf_mode/protocols_isis.py')
-rwxr-xr-x | src/conf_mode/protocols_isis.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_isis.py b/src/conf_mode/protocols_isis.py index ce67ccff7..8d594bb68 100755 --- a/src/conf_mode/protocols_isis.py +++ b/src/conf_mode/protocols_isis.py @@ -220,7 +220,20 @@ def verify(isis): if ("explicit_null" in prefix_config['index']) and ("no_php_flag" in prefix_config['index']): raise ConfigError(f'Segment routing prefix {prefix} cannot have both explicit-null '\ f'and no-php-flag configured at the same time.') - + + # Check for index ranges being larger than the segment routing global block + if dict_search('segment_routing.global_block', isis): + g_high_label_value = dict_search('segment_routing.global_block.high_label_value', isis) + g_low_label_value = dict_search('segment_routing.global_block.low_label_value', isis) + g_label_difference = int(g_high_label_value) - int(g_low_label_value) + if dict_search('segment_routing.prefix', isis): + for prefix, prefix_config in isis['segment_routing']['prefix'].items(): + if 'index' in prefix_config: + index_size = isis['segment_routing']['prefix'][prefix]['index']['value'] + if int(index_size) > int(g_label_difference): + raise ConfigError(f'Segment routing prefix {prefix} cannot have an '\ + f'index base size larger than the SRGB label base.') + # Check for LFA tiebreaker index duplication if dict_search('fast_reroute.lfa.local.tiebreaker', isis): comparison_dictionary = {} |