]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Install a route if the nhe is queued as well
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 25 Jul 2019 15:58:25 +0000 (11:58 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:41 +0000 (11:13 -0400)
Before we install a route, we verify that the nhg_hash_entry is installed.
Allow the nhe to be queued as well and still pass the route
install along.

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

index f1a099bb52225e0923ce272166028b0221040b09..2346cb7f0db0cd26b20e0dcea73ba8a92ad17bdf 100644 (file)
@@ -1527,17 +1527,16 @@ static int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx,
 
 #ifdef HAVE_NETLINK
        if (re->nhe_id && zns->supports_nh) {
-               ctx->u.rinfo.nhe.id = zebra_nhg_get_resolved_id(re->nhe_id);
+               struct nhg_hash_entry *nhe =
+                       zebra_nhg_resolve(zebra_nhg_lookup_id(re->nhe_id));
 
+               ctx->u.rinfo.nhe.id = nhe->id;
                /*
-                * It checks if the nhe is even installed
-                * before trying to uninstall it. If the
-                * nexthop is uninstalled and the kernel
-                * is using nexthop objects, this route
-                * has already been uninstalled.
+                * Check if the nhe is installed/queued before doing anything
+                * with this route.
                 */
-               if (!CHECK_FLAG(zebra_nhg_lookup_id(ctx->u.rinfo.nhe.id)->flags,
-                               NEXTHOP_GROUP_INSTALLED)) {
+               if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)
+                   && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) {
                        ret = ENOENT;
                        goto done;
                }