diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-12-09 08:24:45 -0500 |
---|---|---|
committer | Paul Jakma <paul.jakma@hpe.com> | 2016-02-26 14:11:47 +0000 |
commit | 91ce87aacfd8718b5a52fb0f4453e9f72d8bdb53 (patch) | |
tree | 8abce3edf10e5874aa342090810adcfbf2380053 | |
parent | d18396369ff85517cd4b0b7abe96f6f706710dc7 (diff) | |
download | quagga-91ce87aacfd8718b5a52fb0f4453e9f72d8bdb53.tar.bz2 quagga-91ce87aacfd8718b5a52fb0f4453e9f72d8bdb53.tar.xz |
zebra, bgpd: Fixup MULTIPATH_NUM usage to not consider 0
The code has spots where MULTIPATH_NUM set to 0 is equal to 64.
Now that MULTIPATH_NUM is set from the makefile to never be 0,
remove the code that depends on this.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | bgpd/bgp_vty.c | 4 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 2 | ||||
-rw-r--r-- | zebra/zebra_fpm_netlink.c | 7 |
3 files changed, 6 insertions, 7 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 987ff298..18a22264 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -737,7 +737,7 @@ DEFUN (bgp_maxpaths, return CMD_WARNING; } - 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); @@ -770,7 +770,7 @@ DEFUN (bgp_maxpaths_ibgp, return CMD_WARNING; } - 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); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 2539d614..e4505de3 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1809,7 +1809,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)) diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index c4a650d6..01730007 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -136,10 +136,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; @@ -287,7 +286,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)) |