mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 17:01:49 +00:00
zebra: Add a nhe pointer to the route entry
Add a nexthop hash entry to the route_entry so that we can track the nhe with the route entry. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
3463f295e7
commit
f0cb8e16f0
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user