diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-04 23:46:29 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-05 16:33:42 +0200 |
commit | a3c1db5e1dae10809cb72c8710eb5a99bf253e70 (patch) | |
tree | cc366e0cd986b33e4c17903698c249607f6e69db /vtysh/vtysh_config.c | |
parent | pimd: Fix multicast boundary command (diff) | |
download | frr-a3c1db5e1dae10809cb72c8710eb5a99bf253e70.tar.xz frr-a3c1db5e1dae10809cb72c8710eb5a99bf253e70.zip |
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 <sharp@cumulusnetworks.com>
Diffstat (limited to 'vtysh/vtysh_config.c')
-rw-r--r-- | vtysh/vtysh_config.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index d7e79d6b2..277429a77 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")) |