mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 19:10:35 +00:00
zebra: When passing lookup information back pass the fully resolved
In the reachability code we auto pass back the fully resolved nexthops. Modify the ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB code to do the exact same thing so that the zclient_lookup_nexthop code does not need to recursively look for the data that zebra already has. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
5f179a1a61
commit
b59839af7d
@ -682,6 +682,8 @@ static int zsend_ipv4_nexthop_lookup_mrib(struct zserv *client,
|
|||||||
stream_put_in_addr(s, &addr);
|
stream_put_in_addr(s, &addr);
|
||||||
|
|
||||||
if (re) {
|
if (re) {
|
||||||
|
struct nexthop_group *nhg;
|
||||||
|
|
||||||
stream_putc(s, re->distance);
|
stream_putc(s, re->distance);
|
||||||
stream_putl(s, re->metric);
|
stream_putl(s, re->metric);
|
||||||
num = 0;
|
num = 0;
|
||||||
@ -689,15 +691,11 @@ static int zsend_ipv4_nexthop_lookup_mrib(struct zserv *client,
|
|||||||
nump = stream_get_endp(s);
|
nump = stream_get_endp(s);
|
||||||
/* reserve room for nexthop_num */
|
/* reserve room for nexthop_num */
|
||||||
stream_putc(s, 0);
|
stream_putc(s, 0);
|
||||||
/*
|
nhg = rib_get_fib_nhg(re);
|
||||||
* Only non-recursive routes are elegible to resolve the
|
for (ALL_NEXTHOPS_PTR(nhg, nexthop)) {
|
||||||
* nexthop we are looking up. Therefore, we will just iterate
|
if (rnh_nexthop_valid(re, nexthop))
|
||||||
* over the top chain of nexthops.
|
|
||||||
*/
|
|
||||||
for (nexthop = re->nhe->nhg.nexthop; nexthop;
|
|
||||||
nexthop = nexthop->next)
|
|
||||||
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|
|
||||||
num += zserv_encode_nexthop(s, nexthop);
|
num += zserv_encode_nexthop(s, nexthop);
|
||||||
|
}
|
||||||
|
|
||||||
/* store nexthop_num */
|
/* store nexthop_num */
|
||||||
stream_putc_at(s, nump, num);
|
stream_putc_at(s, nump, num);
|
||||||
|
@ -598,8 +598,7 @@ static const int RNH_INVALID_NH_FLAGS = (NEXTHOP_FLAG_RECURSIVE |
|
|||||||
NEXTHOP_FLAG_DUPLICATE |
|
NEXTHOP_FLAG_DUPLICATE |
|
||||||
NEXTHOP_FLAG_RNH_FILTERED);
|
NEXTHOP_FLAG_RNH_FILTERED);
|
||||||
|
|
||||||
static bool rnh_nexthop_valid(const struct route_entry *re,
|
bool rnh_nexthop_valid(const struct route_entry *re, const struct nexthop *nh)
|
||||||
const struct nexthop *nh)
|
|
||||||
{
|
{
|
||||||
return (CHECK_FLAG(re->status, ROUTE_ENTRY_INSTALLED)
|
return (CHECK_FLAG(re->status, ROUTE_ENTRY_INSTALLED)
|
||||||
&& CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ACTIVE)
|
&& CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ACTIVE)
|
||||||
|
@ -64,6 +64,9 @@ extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
|
|||||||
|
|
||||||
extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
|
extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
|
||||||
|
|
||||||
|
extern bool rnh_nexthop_valid(const struct route_entry *re,
|
||||||
|
const struct nexthop *nh);
|
||||||
|
|
||||||
/* UI control to avoid notifications if backup nexthop status changes */
|
/* UI control to avoid notifications if backup nexthop status changes */
|
||||||
void rnh_set_hide_backups(bool hide_p);
|
void rnh_set_hide_backups(bool hide_p);
|
||||||
bool rnh_get_hide_backups(void);
|
bool rnh_get_hide_backups(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user