]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Check for nh group support in dplane ctx
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 23 Apr 2019 14:24:58 +0000 (10:24 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:40 +0000 (11:13 -0400)
Only queue a nexthop object update if the dataplane
supports nexthop objects. Otherwise, mark it as a success
since we should only me sending them to the kernel
if we think they are valid anywyay.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_dplane.c

index d3e10bbb5d311cac27238b0b0c4967c7b5876ec9..f818ed5bc6e9a205f187af2365a27e9af260e321 100644 (file)
@@ -1593,6 +1593,11 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx,
           structs */
        zns = ((struct zebra_vrf *)vrf_info_lookup(nhe->vrf_id))->zns;
 
+       if (!zns->supports_nh) {
+               ret = EOPNOTSUPP;
+               goto done;
+       }
+
        // TODO: Might not need to mark this as an update, since
        // it probably won't require two messages
        dplane_ctx_ns_init(ctx, zns, (op == DPLANE_OP_NH_UPDATE));
@@ -1885,8 +1890,12 @@ done:
        if (ret == AOK)
                result = ZEBRA_DPLANE_REQUEST_QUEUED;
        else {
-               atomic_fetch_add_explicit(&zdplane_info.dg_nexthop_errors, 1,
-                                         memory_order_relaxed);
+               if (ret == EOPNOTSUPP)
+                       result = ZEBRA_DPLANE_REQUEST_SUCCESS;
+               else
+                       atomic_fetch_add_explicit(
+                               &zdplane_info.dg_nexthop_errors, 1,
+                               memory_order_relaxed);
                if (ctx)
                        dplane_ctx_free(&ctx);
        }