bgpd: Modify maxpaths cli's to use MULTIPATH_NUM for range
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@cumulusnetworks.com>
Tested-by: NetDEF CI System <cisystem@netdef.org>
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 18a2226..6db3dcb 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -715,7 +715,7 @@
/* 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")
{
@@ -737,17 +737,12 @@
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")
@@ -770,11 +765,6 @@
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;
}
@@ -805,7 +795,7 @@
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")
@@ -838,7 +828,7 @@
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"