From: Quentin Young Date: Wed, 21 Jun 2017 15:41:35 +0000 (+0000) Subject: lib: some minor cli fixups for routemap X-Git-Tag: reindent-master-before~42^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=af3346ecd51f872d05b929434f2fe6929e2731ae;p=mirror%2Ffrr.git lib: some minor cli fixups for routemap Need to use the appropriate token field Signed-off-by: Quentin Young --- diff --git a/lib/routemap.c b/lib/routemap.c index f90866194c..386f23f05c 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2472,8 +2472,11 @@ DEFUN (set_metric, int idx_number = 2; VTY_DECLVAR_CONTEXT (route_map_index, index); + const char *pass = (argv[idx_number]->type == RANGE_TKN) ? + argv[idx_number]->arg : argv[idx_number]->text; + if (rmap_match_set_hook.set_metric) - return rmap_match_set_hook.set_metric (vty, index, "metric", argv[idx_number]->arg); + return rmap_match_set_hook.set_metric (vty, index, "metric", pass); return CMD_SUCCESS; } @@ -2603,7 +2606,8 @@ DEFUN (no_route_map, struct route_map *map; struct route_map_index *index; char *endptr = NULL; - int permit = argv[idx_permit_deny]->arg[0] == 'p' ? RMAP_PERMIT : RMAP_DENY; + int permit = strmatch (argv[idx_permit_deny]->text, "permit") ? + RMAP_PERMIT : RMAP_DENY; const char *prefstr = argv[idx_number]->arg; const char *mapname = argv[idx_word]->arg; unsigned long pref = strtoul (prefstr, &endptr, 10);