]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix missing kernel routes
authoranlan_cs <anlan_cs@126.com>
Thu, 31 Oct 2024 14:44:05 +0000 (22:44 +0800)
committeranlan_cs <anlan_cs@126.com>
Thu, 31 Oct 2024 14:45:16 +0000 (22:45 +0800)
The `rib_update_handle_kernel_route_down_possibility()` didn't consider
the kernel routes ( blackhole )  without interface.  When some other
interfaces are down, these kernel routes will be wrongly removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
zebra/zebra_rib.c

index aea39b8ecf18c0f4c69cb944e6314f69af9bd22c..356c5428afb59b94cd6af99f0fc97d7e0d003c53 100644 (file)
@@ -4549,7 +4549,7 @@ rib_update_handle_kernel_route_down_possibility(struct route_node *rn,
                struct interface *ifp = if_lookup_by_index(nexthop->ifindex,
                                                           nexthop->vrf_id);
 
-               if (ifp && if_is_up(ifp)) {
+               if ((ifp && if_is_up(ifp)) || nexthop->type == NEXTHOP_TYPE_BLACKHOLE) {
                        alive = true;
                        break;
                }