From 27805e74f02c9e0b4f0086e8727135788cf9fe2b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 11 Jun 2020 07:34:18 -0400 Subject: [PATCH] zebra: Properly set NEXTHOP_FLAG_FIB when skipping install When the dataplane detects that we have no need to reinstall the same route, setup the NEXTHOP_FLAG_FIB appropriately. Signed-off-by: Donald Sharp --- zebra/zebra_dplane.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index f2725adc54..77abe8bb6d 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -2368,11 +2368,25 @@ dplane_route_update_internal(struct route_node *rn, if ((dplane_ctx_get_type(ctx) == dplane_ctx_get_old_type(ctx)) && (dplane_ctx_get_nhe_id(ctx) == dplane_ctx_get_old_nhe_id(ctx))) { + struct nexthop *nexthop; + if (IS_ZEBRA_DEBUG_DPLANE) zlog_debug( "%s: Ignoring Route exactly the same", __func__); + for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx), + nexthop)) { + if (CHECK_FLAG(nexthop->flags, + NEXTHOP_FLAG_RECURSIVE)) + continue; + + if (CHECK_FLAG(nexthop->flags, + NEXTHOP_FLAG_ACTIVE)) + SET_FLAG(nexthop->flags, + NEXTHOP_FLAG_FIB); + } + return ZEBRA_DPLANE_REQUEST_SUCCESS; } -- 2.39.5