summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-08-11 18:21:12 +0300
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-08-15 20:28:16 +0000
commit412dd286f0b751599cf289b17b8a6e3d87c9b79a (patch)
treec5e79b3ba83c3e31dde2e888080e2c5bc58a16b2
parent00fa3b6c160f15ef050b3324ed6f5eb3322dcec6 (diff)
vtysh: Print uniq lines when parsing `no service ...`
Before this patch: ``` no service cputime-warning no service cputime-warning no ipv6 forwarding no service cputime-warning no service cputime-warning no service cputime-warning ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 8fa9f2bc2af058650c60a574ff99783ca098c046)
-rw-r--r--vtysh/vtysh_config.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 593de7ffbc..685b5f56da 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -484,8 +484,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
config = config_get(RPKI_NODE, line);
else {
if (strncmp(line, "log", strlen("log")) == 0 ||
- strncmp(line, "hostname", strlen("hostname")) ==
- 0 ||
+ strncmp(line, "hostname", strlen("hostname")) == 0 ||
strncmp(line, "domainname", strlen("domainname")) ==
0 ||
strncmp(line, "allow-reserved-ranges",
@@ -497,12 +496,9 @@ void vtysh_config_parse_line(void *arg, const char *line)
strlen("no ip prefix-list")) == 0 ||
strncmp(line, "no ipv6 prefix-list",
strlen("no ipv6 prefix-list")) == 0 ||
- strncmp(line, "service ", strlen("service ")) ==
- 0 ||
- strncmp(line, "no service cputime-stats",
- strlen("no service cputime-stats")) == 0 ||
- strncmp(line, "service cputime-warning",
- strlen("service cputime-warning")) == 0)
+ strncmp(line, "service ", strlen("service ")) == 0 ||
+ strncmp(line, "no service ",
+ strlen("no service ")) == 0)
config_add_line_uniq(config_top, line);
else
config_add_line(config_top, line);