From 1a39fdc21800e828e4c490534a69592e9f730531 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 26 Aug 2020 21:34:22 -0400 Subject: [PATCH] zebra: Short circuit test for nexthop groups when not using When we are not using nexthop groups, there is no need to test for whether or not they are installed correctly or not Signed-off-by: Donald Sharp --- zebra/zebra_dplane.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 6e8d35aa77..cafcebfbc6 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -1911,10 +1911,11 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, * If its a delete we only use the prefix anyway, so this only * matters for INSTALL/UPDATE. */ - if (((op == DPLANE_OP_ROUTE_INSTALL) - || (op == DPLANE_OP_ROUTE_UPDATE)) - && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED) - && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) { + if (zebra_nhg_kernel_nexthops_enabled() + && (((op == DPLANE_OP_ROUTE_INSTALL) + || (op == DPLANE_OP_ROUTE_UPDATE)) + && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED) + && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED))) { ret = ENOENT; goto done; } -- 2.39.5