summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-09-14 17:24:06 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:09 +0100
commit7b2c4d167e1b6ac3e8391f2492cfadc756126542 (patch)
treeb66fe1abd01de95e46684d84b9ff7e1425b67924
parentPIM: json support for "show ip pim" commands (diff)
downloadfrr-7b2c4d167e1b6ac3e8391f2492cfadc756126542.tar.xz
frr-7b2c4d167e1b6ac3e8391f2492cfadc756126542.zip
pimd: Use MULTIPATH_NUM for maxpaths
When looking up nexthops for a address, just use the MULTIPATH_NUM as the number allowed to receive instead of an arbitrary limit of 20 paths. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_pim.h2
-rw-r--r--pimd/pim_rpf.c6
-rw-r--r--pimd/pim_zebra.c4
-rw-r--r--pimd/pim_zlookup.c2
4 files changed, 6 insertions, 8 deletions
diff --git a/pimd/pim_pim.h b/pimd/pim_pim.h
index fad572a12..abb3e50c0 100644
--- a/pimd/pim_pim.h
+++ b/pimd/pim_pim.h
@@ -29,8 +29,6 @@
#define PIM_PIM_BUFSIZE_READ (20000)
#define PIM_PIM_BUFSIZE_WRITE (20000)
-#define PIM_NEXTHOP_IFINDEX_TAB_SIZE (20)
-
#define PIM_DEFAULT_HELLO_PERIOD (30) /* seconds, RFC 4601: 4.11 */
#define PIM_DEFAULT_TRIGGERED_HELLO_DELAY (5) /* seconds, RFC 4601: 4.11 */
#define PIM_DEFAULT_DR_PRIORITY (1) /* RFC 4601: 4.3.1 */
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 6b4dd111e..2e9316269 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -39,15 +39,15 @@ static struct in_addr pim_rpf_find_rpf_addr(struct pim_upstream *up);
int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr)
{
- struct pim_zlookup_nexthop nexthop_tab[PIM_NEXTHOP_IFINDEX_TAB_SIZE];
+ struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM];
int num_ifindex;
struct interface *ifp;
int first_ifindex;
- memset (nexthop_tab, 0, sizeof (struct pim_zlookup_nexthop) * PIM_NEXTHOP_IFINDEX_TAB_SIZE);
+ memset (nexthop_tab, 0, sizeof (struct pim_zlookup_nexthop) * MULTIPATH_NUM);
num_ifindex = zclient_lookup_nexthop(nexthop_tab,
- PIM_NEXTHOP_IFINDEX_TAB_SIZE,
+ MULTIPATH_NUM,
addr, PIM_NEXTHOP_LOOKUP_MAX);
if (num_ifindex < 1) {
char addr_str[100];
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index cfdc447fc..addccef82 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -792,13 +792,13 @@ void igmp_anysource_forward_stop(struct igmp_group *group)
static int fib_lookup_if_vif_index(struct in_addr addr)
{
- struct pim_zlookup_nexthop nexthop_tab[PIM_NEXTHOP_IFINDEX_TAB_SIZE];
+ struct pim_zlookup_nexthop nexthop_tab[MULTIPATH_NUM];
int num_ifindex;
int vif_index;
ifindex_t first_ifindex;
num_ifindex = zclient_lookup_nexthop(nexthop_tab,
- PIM_NEXTHOP_IFINDEX_TAB_SIZE, addr,
+ MULTIPATH_NUM, addr,
PIM_NEXTHOP_LOOKUP_MAX);
if (num_ifindex < 1) {
char addr_str[100];
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c
index 8d7315946..f64909806 100644
--- a/pimd/pim_zlookup.c
+++ b/pimd/pim_zlookup.c
@@ -356,7 +356,7 @@ zclient_lookup_nexthop (struct pim_zlookup_nexthop nexthop_tab[],
struct prefix nexthop_addr;
num_ifindex = zclient_lookup_nexthop_once(nexthop_tab,
- PIM_NEXTHOP_IFINDEX_TAB_SIZE, addr);
+ tab_size, addr);
if (num_ifindex < 1) {
if (PIM_DEBUG_ZEBRA) {
char addr_str[100];