Quagga: Set MULTIPATH_NUM to 64 when user specifies 0 from cli

The code has tests to see if the MULTIPATH_NUM == 0 and to
treat it like the user has entered 'Maximum PATHS'.
This 0 is treated as 64 internally.  Remove this dependency
and setup MULTIPATH_NUM to 64 when --enable-multipath=0 from
the configure cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2015-11-17 08:13:23 -08:00
parent 7717b1837c
commit 7c5d2b76c6
5 changed files with 10 additions and 8 deletions

View file

@ -1000,7 +1000,7 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
bgp_recalculate_all_bestpaths (bgp);
if ((MULTIPATH_NUM != 0) && (maxpaths > MULTIPATH_NUM))
if (maxpaths > MULTIPATH_NUM)
vty_out (vty,
"%% Warning: maximum-paths set to %d is greater than %d that zebra is compiled to support%s",
maxpaths, MULTIPATH_NUM, VTY_NEWLINE);

View file

@ -415,7 +415,10 @@ AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
MULTIPATH_NUM=1
case "${enable_multipath}" in
[[0-9]|[1-9][0-9]])
0)
MULTIPATH_NUM=64
;;
[[1-9]|[1-9][0-9]])
MULTIPATH_NUM="${enable_multipath}"
;;
"")

View file

@ -1987,7 +1987,7 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
nexthop_num = 0;
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
{
if (MULTIPATH_NUM != 0 && nexthop_num >= MULTIPATH_NUM)
if (nexthop_num >= MULTIPATH_NUM)
break;
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))

View file

@ -137,10 +137,9 @@ typedef struct netlink_route_info_t_
int num_nhs;
/*
* Nexthop structures. We keep things simple for now by enforcing a
* maximum of 64 in case MULTIPATH_NUM is 0;
* Nexthop structures
*/
netlink_nh_info_t nhs[MAX (MULTIPATH_NUM, 64)];
netlink_nh_info_t nhs[MULTIPATH_NUM];
union g_addr *pref_src;
} netlink_route_info_t;
@ -288,7 +287,7 @@ netlink_route_info_fill (netlink_route_info_t *ri, int cmd,
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
{
if (MULTIPATH_NUM != 0 && ri->num_nhs >= MULTIPATH_NUM)
if (ri->num_nhs >= MULTIPATH_NUM)
break;
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))

View file

@ -1042,7 +1042,7 @@ zread_interface_delete (struct zserv *client, u_short length, vrf_id_t vrf_id)
void
zserv_nexthop_num_warn (const char *caller, const struct prefix *p, const u_char nexthop_num)
{
if ((MULTIPATH_NUM != 0) && (nexthop_num > MULTIPATH_NUM))
if (nexthop_num > MULTIPATH_NUM)
{
char buff[80];
prefix2str(p, buff, 80);