]> git.puffer.fish Git - mirror/frr.git/commitdiff
Quagga: Set MULTIPATH_NUM to 64 when user specifies 0 from cli
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 17 Nov 2015 16:13:23 +0000 (08:13 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 17 Nov 2015 16:13:23 +0000 (08:13 -0800)
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>
bgpd/bgp_vty.c
configure.ac
zebra/rt_netlink.c
zebra/zebra_fpm_netlink.c
zebra/zserv.c

index fd096eff2254b20457ce281ba5f323640a3d11f2..de6f4d8b56415581f188c7efb1d878716c5c395f 100644 (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);
index e44823262c2d8dd570ad22c890f55c5d2125ccbd..40c11e7fb7cc7c32dec318e73788c56f337275c4 100755 (executable)
@@ -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}"
     ;;
   "")
index cad367808db30ab947c919ee4347481aa92f97fb..a4da7f079d2d5d844b052e4f1fdef853c2ea281a 100644 (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))
index 1eec867041536f388b87f8f183c651670efd009c..c53d282b6351bd255cec6deba5a2691d02aa36f3 100644 (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))
index 3f7d73285fef9cf83b9c5647624a555e6574e89d..87fa5ce49ccd0d7ae34e147d0546c938b0eeb659 100644 (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);