]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Convert BGP_MAXIMUM_MAXPATHS to MULTIPATH_NUM
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Dec 2015 14:19:39 +0000 (14:19 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Dec 2015 18:07:03 +0000 (10:07 -0800)
There is no point in allowing more BGP_MAXIMUM_MAXPATHS than
MULTIPATH_NUM.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_mpath.h
bgpd/bgp_vty.c
bgpd/bgp_zebra.c

index 9120ca3433bea157e8e8272dc18b92303ee79cdc..0a51c98d06602e846dfd9822c1a44fbdee899615 100644 (file)
@@ -24,9 +24,6 @@
 #ifndef _QUAGGA_BGP_MPATH_H
 #define _QUAGGA_BGP_MPATH_H
 
-/* Limit on number of configured maxpaths */
-#define BGP_MAXIMUM_MAXPATHS 255
-
 /* Supplemental information linked to bgp_info for keeping track of
  * multipath selections, lazily allocated to save memory
  */
index a733c80682e736bcb74fae0de8fc7641da0cf31d..02a066102cad1e88979982332002c98b70760efc 100644 (file)
@@ -992,7 +992,7 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
   if (set)
     {
       VTY_GET_INTEGER_RANGE ("maximum-paths", maxpaths, mpaths, 1,
-                             BGP_MAXIMUM_MAXPATHS);
+                             MULTIPATH_NUM);
       ret = bgp_maximum_paths_set (bgp, afi, safi, peer_type, maxpaths,
                                   options);
     }
@@ -1011,11 +1011,6 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
 
   bgp_recalculate_all_bestpaths (bgp);
 
-  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);
-
   return CMD_SUCCESS;
 }
 
index 07532d93facbd5147722b440d348cf90461ab04a..707476e818fc8f657f5d9729d9d88aba0b5149a9 100644 (file)
@@ -62,22 +62,22 @@ struct stream *bgp_ifindices_buf = NULL;
      1. maintain a linked-list and free it after zapi_*_route call
      2. use an array to avoid number of mallocs.
    Number of supported next-hops are finite, use of arrays should be ok. */
-struct attr attr_cp[BGP_MAXIMUM_MAXPATHS];
-struct attr_extra attr_extra_cp[BGP_MAXIMUM_MAXPATHS];
+struct attr attr_cp[MULTIPATH_NUM];
+struct attr_extra attr_extra_cp[MULTIPATH_NUM];
 int    attr_index = 0;
 
 /* Once per address-family initialization of the attribute array */
 #define BGP_INFO_ATTR_BUF_INIT()\
 do {\
-  memset(attr_cp, 0, BGP_MAXIMUM_MAXPATHS * sizeof(struct attr));\
-  memset(attr_extra_cp, 0, BGP_MAXIMUM_MAXPATHS * sizeof(struct attr_extra));\
+  memset(attr_cp, 0, MULTIPATH_NUM * sizeof(struct attr));\
+  memset(attr_extra_cp, 0, MULTIPATH_NUM * sizeof(struct attr_extra));\
   attr_index = 0;\
 } while (0)
 
 #define BGP_INFO_ATTR_BUF_COPY(info_src, info_dst)\
 do { \
   *info_dst = *info_src; \
-  assert(attr_index != BGP_MAXIMUM_MAXPATHS);\
+  assert(attr_index != MULTIPATH_NUM);\
   attr_cp[attr_index].extra = &attr_extra_cp[attr_index]; \
   bgp_attr_dup (&attr_cp[attr_index], info_src->attr); \
   bgp_attr_deep_dup (&attr_cp[attr_index], info_src->attr); \