]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Install the nhe along with the route
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 25 Jul 2019 17:14:32 +0000 (13:14 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:41 +0000 (11:13 -0400)
Move the installation of an nhe out of nexthop_active_update()
and into the rib install path. So, only install the nhe when
a route using it is being installed.

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

index 13ea902543460b96a990d57cba9818a1a6bc42af..a28f183895f9d263c5cabe6cb5f43b49a51faa0d 100644 (file)
@@ -1398,12 +1398,9 @@ int nexthop_active_update(struct route_node *rn, struct route_entry *re)
 
                nhe = zebra_nhg_lookup_id(re->nhe_id);
 
-               if (nhe) {
+               if (nhe)
                        SET_FLAG(nhe->flags, NEXTHOP_GROUP_VALID);
-                       if (!nhe->is_kernel_nh
-                           && !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_RECURSIVE))
-                               zebra_nhg_install_kernel(nhe);
-               } else
+               else
                        flog_err(
                                EC_ZEBRA_TABLE_LOOKUP_FAILED,
                                "Active update on NHE id=%u that we do not have in our tables",
index 6be91da54aa90c9afad02655854057e9f1cdf2b1..67b4afb3a5106300da03297ad312e8297f71d325 100644 (file)
@@ -519,6 +519,7 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
        struct zebra_vrf *zvrf = vrf_info_lookup(re->vrf_id);
        const struct prefix *p, *src_p;
        enum zebra_dplane_result ret;
+       struct nhg_hash_entry *nhe;
 
        rib_dest_t *dest = rib_dest_from_rnode(rn);
 
@@ -545,6 +546,13 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
                }
        }
 
+       /*
+        * Install the resolved nexthop object first.
+        */
+       nhe = zebra_nhg_resolve(zebra_nhg_lookup_id(re->nhe_id));
+       if (!nhe->is_kernel_nh)
+               zebra_nhg_install_kernel(nhe);
+
        /*
         * If this is a replace to a new RE let the originator of the RE
         * know that they've lost