summaryrefslogtreecommitdiff
path: root/lib/routemap.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-03-21 08:58:51 +0200
committerGitHub <noreply@github.com>2023-03-21 08:58:51 +0200
commitd76f782c8470a61e4522ad598bd8f7c2f2f643e3 (patch)
tree5a796a5848e05795f70b7882c19d119b8a874710 /lib/routemap.c
parentad959654f5bca91d935fed4471edc2d1f327f09b (diff)
parent463110f7335632d03557f1c5bfdd066b170011a8 (diff)
Merge pull request #13064 from chiragshah6/fdev1
lib: fix clear route-map command
Diffstat (limited to 'lib/routemap.c')
-rw-r--r--lib/routemap.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 9f5c9e693e..16da81fa74 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -3101,27 +3101,24 @@ static void clear_route_map_helper(struct route_map *map)
index->applied_clear = index->applied;
}
-DEFUN (rmap_clear_counters,
+DEFPY (rmap_clear_counters,
rmap_clear_counters_cmd,
- "clear route-map counters [WORD]",
+ "clear route-map counters [RMAP_NAME$rmapname]",
CLEAR_STR
"route-map information\n"
"counters associated with the specified route-map\n"
"route-map name\n")
{
- int idx_word = 2;
struct route_map *map;
- const char *name = (argc == 3 ) ? argv[idx_word]->arg : NULL;
-
- if (name) {
- map = route_map_lookup_by_name(name);
+ if (rmapname) {
+ map = route_map_lookup_by_name(rmapname);
if (map)
clear_route_map_helper(map);
else {
vty_out(vty, "%s: 'route-map %s' not found\n",
- frr_protonameinst, name);
+ frr_protonameinst, rmapname);
return CMD_SUCCESS;
}
} else {