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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-08-26 21:34:22 -04:00
parent ff35a11676
commit 1a39fdc218

View File

@ -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)
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)) {
&& !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED))) {
ret = ENOENT;
goto done;
}