diff --git a/zebra/rib.h b/zebra/rib.h index 5b5bd4c279..a95bcc0550 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -93,6 +93,8 @@ struct route_entry { /* Nexthop group from FIB (optional) */ struct nexthop_group fib_ng; + struct nhg_hash_entry *nhe; + /* Tag */ route_tag_t tag; diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 47e1054cef..1839133310 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -158,8 +158,9 @@ bool zebra_nhg_hash_equal(const void *arg1, const void *arg2) * * Avoiding code duplication hopefully. */ -static void zebra_nhg_lookup_get(struct hash *hash_table, - struct nhg_hash_entry *lookup) +static struct nhg_hash_entry * +zebra_nhg_lookup_get(struct hash *hash_table, + struct nhg_hash_entry *lookup) { struct nhg_hash_entry *nhe; @@ -170,9 +171,7 @@ static void zebra_nhg_lookup_get(struct hash *hash_table, else nhe->refcnt++; - //re->ng = nhe->nhg; - - return; + return nhe; } void zebra_nhg_find_id(uint32_t id, struct nexthop_group *nhg) @@ -194,7 +193,7 @@ void zebra_nhg_find(afi_t afi, struct nexthop_group *nhg, lookup.afi = afi; lookup.nhg = *nhg; - zebra_nhg_lookup_get(zrouter.nhgs, &lookup); + re->nhe = zebra_nhg_lookup_get(zrouter.nhgs, &lookup); } void zebra_nhg_release(afi_t afi, struct route_entry *re)