From 09f6d019b4c353373b3944a0f80ab51c06998410 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 11 Jan 2018 11:31:45 -0500 Subject: lib, bgpd: fixup use of of CMD_ARGC_MAX The constant to limit # of allowed cli tokens on any one line was defined in multiple places, all inconsistent with each other. Fix. Signed-off-by: Quentin Young --- lib/command_match.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/command_match.c') diff --git a/lib/command_match.c b/lib/command_match.c index c60373f910..f6b07a0b20 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -28,8 +28,6 @@ DEFINE_MTYPE_STATIC(LIB, CMD_MATCHSTACK, "Command Match Stack") -#define MAXDEPTH 256 - #ifdef TRACE_MATCHER #define TM 1 #else @@ -84,7 +82,7 @@ static enum match_type match_mac(const char *, bool); enum matcher_rv command_match(struct graph *cmdgraph, vector vline, struct list **argv, const struct cmd_element **el) { - struct graph_node *stack[MAXDEPTH]; + struct graph_node *stack[CMD_ARGC_MAX]; enum matcher_rv status; *argv = NULL; @@ -200,7 +198,7 @@ static enum matcher_rv command_match_r(struct graph_node *start, vector vline, /* check history/stack of tokens * this disallows matching the same one more than once if there is a * circle in the graph (used for keyword arguments) */ - if (n == MAXDEPTH) + if (n == CMD_ARGC_MAX) return MATCHER_NO_MATCH; if (!token->allowrepeat) for (size_t s = 0; s < n; s++) -- cgit v1.2.3