mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 06:53:03 +00:00
zebra: add a fib-specific nexthop-group
Add a fib-specific nhg, distinct from the nhg developed from the route-owner / RIB information. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
593e4eb1e8
commit
ee5e8a4820
15
zebra/rib.h
15
zebra/rib.h
@ -87,9 +87,12 @@ struct route_entry {
|
|||||||
/* Link list. */
|
/* Link list. */
|
||||||
struct re_list_item next;
|
struct re_list_item next;
|
||||||
|
|
||||||
/* Nexthop structure */
|
/* Nexthop structure (from RIB) */
|
||||||
struct nexthop_group ng;
|
struct nexthop_group ng;
|
||||||
|
|
||||||
|
/* Nexthop group from FIB (optional) */
|
||||||
|
struct nexthop_group fib_ng;
|
||||||
|
|
||||||
/* Tag */
|
/* Tag */
|
||||||
route_tag_t tag;
|
route_tag_t tag;
|
||||||
|
|
||||||
@ -529,6 +532,16 @@ static inline void rib_tables_iter_cleanup(rib_tables_iter_t *iter)
|
|||||||
DECLARE_HOOK(rib_update, (struct route_node * rn, const char *reason),
|
DECLARE_HOOK(rib_update, (struct route_node * rn, const char *reason),
|
||||||
(rn, reason))
|
(rn, reason))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Access active nexthop-group, either RIB or FIB version
|
||||||
|
*/
|
||||||
|
static inline struct nexthop_group *rib_active_nhg(struct route_entry *re)
|
||||||
|
{
|
||||||
|
if (re->fib_ng.nexthop)
|
||||||
|
return &(re->fib_ng);
|
||||||
|
else
|
||||||
|
return &(re->ng);
|
||||||
|
}
|
||||||
|
|
||||||
extern void zebra_vty_init(void);
|
extern void zebra_vty_init(void);
|
||||||
|
|
||||||
|
@ -2585,6 +2585,8 @@ void rib_unlink(struct route_node *rn, struct route_entry *re)
|
|||||||
dest->selected_fib = NULL;
|
dest->selected_fib = NULL;
|
||||||
|
|
||||||
nexthops_free(re->ng.nexthop);
|
nexthops_free(re->ng.nexthop);
|
||||||
|
nexthops_free(re->fib_ng.nexthop);
|
||||||
|
|
||||||
XFREE(MTYPE_RE, re);
|
XFREE(MTYPE_RE, re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user