]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: some minor cli fixups for routemap 735/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 21 Jun 2017 15:41:35 +0000 (15:41 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 21 Jun 2017 15:41:35 +0000 (15:41 +0000)
Need to use the appropriate token field

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/routemap.c

index f90866194c9ecc300ddcd4f85f7b8afc1e924b47..386f23f05cb07ab7b729f46cb76b09256d3138e9 100644 (file)
@@ -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);