if (!nhe->is_kernel_nh && nhe->refcnt <= 0) {
zebra_nhg_uninstall_kernel(nhe);
}
+}
+
+/**
+ * zebra_nhg_increment_ref() - Increment the reference count
+ *
+ * @nhe: Nexthop group hash entry
+ */
+void zebra_nhg_increment_ref(struct nhg_hash_entry *nhe)
+{
+ if (nhe->nhg_depends) {
+ struct listnode *ln = NULL;
+ struct nhg_depend *n_dp = NULL;
+
+ for (ALL_LIST_ELEMENTS_RO(nhe->nhg_depends, ln, n_dp)) {
+ zebra_nhg_increment_ref(n_dp->nhe);
+ }
+ }
- // re->ng = NULL;
+ nhe->refcnt++;
}
static void nexthop_set_resolved(afi_t afi, const struct nexthop *newhop,
void zebra_nhg_free(void *arg);
void zebra_nhg_release(struct nhg_hash_entry *nhe);
void zebra_nhg_decrement_ref(struct nhg_hash_entry *nhe);
+void zebra_nhg_increment_ref(struct nhg_hash_entry *nhe);
extern int nexthop_active_update(struct route_node *rn, struct route_entry *re);