diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 13ea902543..a28f183895 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -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", diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 6be91da54a..67b4afb3a5 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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