ospfd: Correct invalid SR-MPLS output label #17495
Merged
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.
When OSPFd starts, there is 2 possible scenarios for Segment Routing: 1/ Routes associated to Prefixes are not yet available i.e. Segment Routing LSA are received before LSA Type 1. In this case, the function ospf_sr_nhlfe_update() is triggered when a new SPF is launch. Thus, neighbors and output label are always synchronise with the routing table. 2/ Routes are already available i.e. LSA Type 1 are received before Segment Routing LSA, in particular the Router Information which contains the SRGB. During nhlfe computation, perfixes are leave with incomplete configuration, in particular, the SR nexthop is set to NULL. If this scenario is handle through the function update_out_nhlfe (triggered when SRGB is received or modified from a neighbor node), the output label is not correctly configured as the nexthop SR node associated to the prefix has been leave to NULL.
This patch correct this problem by calling the function compute_nhlfe() when the nexthop SR Node associated to the prefix is NULL within the update_out_nhlfe() function. Thus, we guarantee that the SR prefix is always correctly configuration indpedently of the scenario i.e. arrival of the different LSA.