From 513c846203f01e35f840842d253f15030c42b85f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 4 Oct 2017 17:32:48 -0400 Subject: [PATCH 1/2] pimd: Fix multicast boundary command 1) Fix missing newlines 2) Write the correct cli out. Signed-off-by: Donald Sharp --- pimd/pim_cmd.c | 4 ++-- pimd/pim_vty.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 144785a5cd..7ce345d8e3 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -6480,7 +6480,7 @@ DEFUN(interface_ip_pim_boundary_oil, "Generic multicast configuration options\n" "Define multicast boundary\n" "Filter OIL by group using prefix list\n" - "Prefix list to filter OIL with") + "Prefix list to filter OIL with\n") { VTY_DECLVAR_CONTEXT(interface, iif); struct pim_interface *pim_ifp; @@ -6508,7 +6508,7 @@ DEFUN(interface_no_ip_pim_boundary_oil, "Generic multicast configuration options\n" "Define multicast boundary\n" "Filter OIL by group using prefix list\n" - "Prefix list to filter OIL with") + "Prefix list to filter OIL with\n") { VTY_DECLVAR_CONTEXT(interface, iif); struct pim_interface *pim_ifp; diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index c1adbcc915..fc377b5a52 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -362,7 +362,7 @@ int pim_interface_config_write(struct vty *vty) /* boundary */ if (pim_ifp->boundary_oil_plist) { vty_out(vty, - " ip pim boundary oil %s\n", + " ip multicast boundary oil %s\n", pim_ifp->boundary_oil_plist); ++writes; } From a3c1db5e1dae10809cb72c8710eb5a99bf253e70 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 4 Oct 2017 17:46:29 -0400 Subject: [PATCH 2/2] vtysh: Fix ordering of multicast boundary command The multicast boundary command must be shown after the `ip pim sm` command. So add a new config_add_line_end and make it the last one. Signed-off-by: Donald Sharp --- vtysh/vtysh_config.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index d7e79d6b2c..277429a779 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -131,6 +131,20 @@ static void config_add_line_uniq(struct list *config, const char *line) listnode_add_sort(config, XSTRDUP(MTYPE_VTYSH_CONFIG_LINE, line)); } +/* + * I want to explicitly move this command to the end of the line + */ +static void config_add_line_end(struct list *config, const char *line) +{ + struct listnode *node; + void *item = XSTRDUP(MTYPE_VTYSH_CONFIG_LINE, line); + + listnode_add(config, item); + node = listnode_lookup(config, item); + if (node) + listnode_move_to_tail(config, node); +} + void vtysh_config_parse_line(void *arg, const char *line) { char c; @@ -161,6 +175,10 @@ void vtysh_config_parse_line(void *arg, const char *line) == 0) { config_add_line(config->line, line); config->index = LINK_PARAMS_NODE; + } else if (strncmp(line, + " ip multicast boundary", + strlen(" ip multicast boundary")) == 0) { + config_add_line_end(config->line, line); } else if (config->index == LINK_PARAMS_NODE && strncmp(line, " exit-link-params", strlen(" exit"))