Move the resolving and installing of a single nhg_hash_entry
into the install function itself, rather than letting zebra_rib
handle it.
Further, ensure depends are installed/queued before installing
a group. The ordering should be find here since only one thread
will call this API.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe)
{
+ struct nhg_connected *rb_node_dep = NULL;
+
+ /* Resolve it first */
+ nhe = zebra_nhg_resolve(nhe);
+
+ /* Make sure all depends are installed/queued */
+ frr_each (nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
+ zebra_nhg_install_kernel(rb_node_dep->nhe);
+ }
+
if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)
&& !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) {
nhe->is_kernel_nh = false;
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);
+ zebra_nhg_install_kernel(zebra_nhg_lookup_id(re->nhe_id));
/*
* If this is a replace to a new RE let the originator of the RE