T5916: Added segment routing check for index size and SRGB size #2780
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Summary
We are adding a check to make sure that the segment routing global base and
the index base do not have a size mismatch. Originally one could configure a
larger index size than segment routing global base size. This is a small check to
prevent that type of configuration in the future.
Types of changes
Related Task(s)
Related PR(s)
No
Component(s) name
isis, ospf
Proposed changes
What we are basically adding here is a check to first gather the segment routing
global block and to basically calculate how large it is in size. This is done by checking
the maximum and minimum values and doing just a simple subtraction. Then we do
a check for each prefix that is configured inside of segment routing in IS-IS and OSPF
to make sure that if an index is configured that the size is smaller than the segment
routing global base size.
How to test
Baseline configs are:
If one reduces the size of the IS-IS SRGB or OSPF SRGB to below the size of
the index size, we get the following error for both protocols:
Individually they work too:
Smoketest result
I didn't include a smoketest because the smoketest is not needed in this case.
The smoketest we do already configures the values correctly.
Checklist: