[quagga-dev 14125] [PATCH 4/4] bgpd: Modify maxpaths cli's to use MULTIPATH_NUM for range

Donald Sharp sharpd at cumulusnetworks.com
Wed Dec 9 13:24:47 GMT 2015


Modify the various maxpath commands to use MULTIPATH_NUM
as the upper limit of allowed max paths in BGP.  There
is no point in allowing a number of maximum paths greater
than what Quagga is compiled for.

Signed-off-by: Donald Sharp <sharpd at cumulusnetworks.com>
---
 bgpd/bgp_vty.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index c6bf328..56e14c4 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -654,7 +654,7 @@ DEFUN (no_bgp_confederation_peers,
 /* Maximum-paths configuration */
 DEFUN (bgp_maxpaths,
        bgp_maxpaths_cmd,
-       "maximum-paths <1-255>",
+       "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM),
        "Forward packets over multiple paths\n"
        "Number of paths\n")
 {
@@ -676,17 +676,12 @@ DEFUN (bgp_maxpaths,
       return CMD_WARNING;
     }
 
-  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;
 }
 
 DEFUN (bgp_maxpaths_ibgp,
        bgp_maxpaths_ibgp_cmd,
-       "maximum-paths ibgp <1-255>",
+       "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM),
        "Forward packets over multiple paths\n"
        "iBGP-multipath\n"
        "Number of paths\n")
@@ -709,11 +704,6 @@ DEFUN (bgp_maxpaths_ibgp,
       return CMD_WARNING;
     }
 
-  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;
 }
 
@@ -744,7 +734,7 @@ DEFUN (no_bgp_maxpaths,
 
 ALIAS (no_bgp_maxpaths,
        no_bgp_maxpaths_arg_cmd,
-       "no maximum-paths <1-255>",
+       "no maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM),
        NO_STR
        "Forward packets over multiple paths\n"
        "Number of paths\n")
@@ -777,7 +767,7 @@ DEFUN (no_bgp_maxpaths_ibgp,
 
 ALIAS (no_bgp_maxpaths_ibgp,
        no_bgp_maxpaths_ibgp_arg_cmd,
-       "no maximum-paths ibgp <1-255>",
+       "no maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM),
        NO_STR
        "Forward packets over multiple paths\n"
        "iBGP-multipath\n"
@@ -2905,7 +2895,7 @@ DEFUN (neighbor_ebgp_multihop,
 
 DEFUN (neighbor_ebgp_multihop_ttl,
        neighbor_ebgp_multihop_ttl_cmd,
-       NEIGHBOR_CMD2 "ebgp-multihop <1-255>",
+       NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MULTIPATH_NUM),
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
        "Allow EBGP neighbors not on directly connected networks\n"
@@ -2927,7 +2917,7 @@ DEFUN (no_neighbor_ebgp_multihop,
 
 ALIAS (no_neighbor_ebgp_multihop,
        no_neighbor_ebgp_multihop_ttl_cmd,
-       NO_NEIGHBOR_CMD2 "ebgp-multihop <1-255>",
+       NO_NEIGHBOR_CMD2 "ebgp-multihop " CMD_RANGE_STR(1, MULTIPATH_NUM),
        NO_STR
        NEIGHBOR_STR
        NEIGHBOR_ADDR_STR2
-- 
1.7.10.4





More information about the Quagga-dev mailing list