]> 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)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 5 Nov 2024 15:22:23 +0000 (15:22 +0000)
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>
(cherry picked from commit 44a82da405879b1318f046dc67893934b57cbf37)

zebra/zebra_rib.c

index 4c70013701f535e6479c8818ff16cc968d25a7f9..752f8282df69bc854e3e971d27654497845b1c5c 100644 (file)
@@ -4490,7 +4490,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;
                }