From 3cb4dcda5cd000d3108db67414f83e58638d62d0 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 (cherry picked from commit 44a82da405879b1318f046dc67893934b57cbf37) --- 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 4c70013701..752f8282df 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; }