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>
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",
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);
}
}
+ /*
+ * 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