lib, zebra: Check for not being a blackhole route#15815
Merged
mjstapp merged 1 commit intoFRRouting:masterfrom Apr 23, 2024
Merged
lib, zebra: Check for not being a blackhole route#15815mjstapp merged 1 commit intoFRRouting:masterfrom
mjstapp merged 1 commit intoFRRouting:masterfrom
Conversation
In zebra_interface_nhg_reinstall zebra is checking that the nhg is a singleton and not a blackhole nhg. This was originally done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX, NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX. This was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6. These were both possible to be received and maintained from the upper level protocol for when a route is being recursively resolved. If we have gotten to this point in zebra_interface_nhg_reinstall the nexthop group has already been installed at least once and we *know* that it is actually a valid nexthop. What the test is really trying to do is ensure that we are not reinstalling a blackhole nexthop group( Which is not possible to even be here by the way, but safety first! ). So let's change to test for that instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
mjstapp
approved these changes
Apr 22, 2024
Contributor
mjstapp
left a comment
There was a problem hiding this comment.
Nice catch - looks good to me
pguibert6WIND
approved these changes
Apr 22, 2024
Member
pguibert6WIND
left a comment
There was a problem hiding this comment.
LGTM for blackhole cases.
It makes me think to an exception case handled in zebra_nhg.c about a resolved route pointing over the default route.
Do we have to add that kind of test in nhg_reinstall ?
[0] https://github.com/FRRouting/frr/blob/master/zebra/zebra_nhg.c#L2345
Member
|
@Mergifyio backport stable/10.0 stable/9.1 stable/9.0 stable/8.5 |
✅ Backports have been createdDetails
|
This was referenced Apr 23, 2024
donaldsharp
added a commit
that referenced
this pull request
Apr 23, 2024
lib, zebra: Check for not being a blackhole route (backport #15815)
donaldsharp
added a commit
that referenced
this pull request
Apr 23, 2024
lib, zebra: Check for not being a blackhole route (backport #15815)
donaldsharp
added a commit
that referenced
this pull request
Apr 23, 2024
lib, zebra: Check for not being a blackhole route (backport #15815)
donaldsharp
added a commit
that referenced
this pull request
Apr 23, 2024
lib, zebra: Check for not being a blackhole route (backport #15815)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In zebra_interface_nhg_reinstall zebra is checking that the nhg is a singleton and not a blackhole nhg. This was originally done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX, NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX. This was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6. These were both possible to be received and maintained from the upper level protocol for when a route is being recursively resolved. If we have gotten to this point in zebra_interface_nhg_reinstall the nexthop group has already been installed at least once and we know that it is actually a valid nexthop. What the test is really trying to do is ensure that we are not reinstalling a blackhole nexthop group( Which is not possible to even be here by the way, but safety first! ). So let's change to test for that instead.