From 54b7d471f34a6f2150ecae2d925263681258ced2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 27 Sep 2022 09:02:26 -0400 Subject: [PATCH] vtysh: Properly handle `[no] service cputime-stats` in config Prevent duplicate lines from each daemon in vtysh output. Fixes: #12022 Signed-off-by: Donald Sharp --- vtysh/vtysh_config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index a7ec2a93c2..d4628839dc 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -489,7 +489,11 @@ void vtysh_config_parse_line(void *arg, const char *line) strncmp(line, "no ip prefix-list", strlen("no ip prefix-list")) == 0 || strncmp(line, "no ipv6 prefix-list", - strlen("no ipv6 prefix-list")) == 0) + strlen("no ipv6 prefix-list")) == 0 || + strncmp(line, "service cputime-stats", + strlen("service cputime-stats")) == 0 || + strncmp(line, "no service cputime-stats", + strlen("no service cputime-stats")) == 0) config_add_line_uniq(config_top, line); else config_add_line(config_top, line);