diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-06-22 14:12:04 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-06-23 19:29:19 +0200 |
commit | 75700af6027073a2ede58b429ec49b6beb05dcb3 (patch) | |
tree | 18a84e3f929f681e2c2232fca177a72f49febdc6 /pimd/pim_nht.c | |
parent | bgpd: Cleanup pointer assignment so compiler doesn't get confused (diff) | |
download | frr-75700af6027073a2ede58b429ec49b6beb05dcb3.tar.xz frr-75700af6027073a2ede58b429ec49b6beb05dcb3.zip |
pimd: Limit pim's ecmp to what zebra tells us is the multipath
Zebra can be setup to use a value that is less than MULTIPATH_NUM.
When pimd connects to zebra, zebra will inform pim about the MULTIPATH_NUM
used. Let's use that value for figuring out our multipath value.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pimd/pim_nht.c')
-rw-r--r-- | pimd/pim_nht.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 22716c2a9..564d16a60 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -304,15 +304,15 @@ bool pim_nht_bsr_rpf_check(struct pim_instance *pim, struct in_addr bsr_addr, * "check cache or get immediate result." But until that can * be worked in, here's a copy of the code below :( */ - struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM]; + struct pim_zlookup_nexthop nexthop_tab[router->multipath]; ifindex_t i; struct interface *ifp = NULL; int num_ifindex; memset(nexthop_tab, 0, sizeof(nexthop_tab)); - num_ifindex = zclient_lookup_nexthop(pim, nexthop_tab, - MULTIPATH_NUM, bsr_addr, - PIM_NEXTHOP_LOOKUP_MAX); + num_ifindex = zclient_lookup_nexthop( + pim, nexthop_tab, router->multipath, bsr_addr, + PIM_NEXTHOP_LOOKUP_MAX); if (num_ifindex <= 0) return false; @@ -501,8 +501,8 @@ static int pim_ecmp_nexthop_search(struct pim_instance *pim, struct prefix *src, struct prefix *grp, int neighbor_needed) { - struct pim_neighbor *nbrs[MULTIPATH_NUM], *nbr = NULL; - struct interface *ifps[MULTIPATH_NUM]; + struct pim_neighbor *nbrs[router->multipath], *nbr = NULL; + struct interface *ifps[router->multipath]; struct nexthop *nh_node = NULL; ifindex_t first_ifindex; struct interface *ifp = NULL; @@ -888,11 +888,11 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim, struct prefix *grp, int neighbor_needed) { struct pim_nexthop_cache *pnc; - struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM]; - struct pim_neighbor *nbrs[MULTIPATH_NUM], *nbr = NULL; + struct pim_zlookup_nexthop nexthop_tab[router->multipath]; + struct pim_neighbor *nbrs[router->multipath], *nbr = NULL; struct pim_rpf rpf; int num_ifindex; - struct interface *ifps[MULTIPATH_NUM], *ifp; + struct interface *ifps[router->multipath], *ifp; int first_ifindex; int found = 0; uint8_t i = 0; @@ -915,9 +915,10 @@ int pim_ecmp_nexthop_lookup(struct pim_instance *pim, } memset(nexthop_tab, 0, - sizeof(struct pim_zlookup_nexthop) * MULTIPATH_NUM); - num_ifindex = zclient_lookup_nexthop(pim, nexthop_tab, MULTIPATH_NUM, - src_addr, PIM_NEXTHOP_LOOKUP_MAX); + sizeof(struct pim_zlookup_nexthop) * router->multipath); + num_ifindex = + zclient_lookup_nexthop(pim, nexthop_tab, router->multipath, + src_addr, PIM_NEXTHOP_LOOKUP_MAX); if (num_ifindex < 1) { if (PIM_DEBUG_PIM_NHT) zlog_warn( |