From 44a82da405879b1318f046dc67893934b57cbf37 Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Thu, 31 Oct 2024 22:44:05 +0800 Subject: [PATCH] zebra: fix missing kernel routes 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 --- zebra/zebra_rib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index aea39b8ecf..356c5428af 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; }