summaryrefslogtreecommitdiff
path: root/zebra/zebra_nhg.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-04-19 12:13:32 -0400
committerDonald Sharp <sharpd@nvidia.com>2024-04-22 10:44:55 -0400
commit29c1ff446e581fc403d155fd1d00b7c944cba56a (patch)
treea02d61ed9cee361aaaab6ee59937a6581bb1ffe1 /zebra/zebra_nhg.c
parent7f7bcb1ffa636318659abb16c7690d9875577ef9 (diff)
lib, zebra: Check for not being a blackhole route
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>
Diffstat (limited to 'zebra/zebra_nhg.c')
-rw-r--r--zebra/zebra_nhg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index ff97a11c17..1246e4dba2 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -3664,8 +3664,9 @@ void zebra_interface_nhg_reinstall(struct interface *ifp)
"%s: Setting the valid flag for nhe %pNG, interface: %s",
__func__, rb_node_dep->nhe, ifp->name);
}
+
/* Check for singleton NHG associated to interface */
- if (nexthop_is_ifindex_type(nh) &&
+ if (!nexthop_is_blackhole(nh) &&
zebra_nhg_depends_is_empty(rb_node_dep->nhe)) {
struct nhg_connected *rb_node_dependent;