zebra: fix link-params CLI handling
vtysh was breaking in a rather ugly way, and some "no" forms were
missing too.
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index c80c42a..e6d8823 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -184,8 +184,20 @@
else if (strncmp (line, " address-family ipv6",
strlen (" address-family ipv6")) == 0)
config = config_get (BGP_IPV6_NODE, line);
+ else if (strncmp (line, " link-params", strlen (" link-params")) == 0)
+ {
+ config_add_line (config->line, line);
+ config->index = LINK_PARAMS_NODE;
+ }
+ else if (config->index == LINK_PARAMS_NODE &&
+ strncmp (line, " exit", strlen (" exit")) == 0)
+ {
+ config_add_line (config->line, line);
+ config->index = INTERFACE_NODE;
+ }
else if (config->index == RMAP_NODE ||
- config->index == VTY_NODE)
+ config->index == INTERFACE_NODE ||
+ config->index == VTY_NODE)
config_add_line_uniq (config->line, line);
else
config_add_line (config->line, line);
diff --git a/zebra/interface.c b/zebra/interface.c
index 5e89db9..c5835f4 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -2636,6 +2636,7 @@
if (IS_PARAM_SET(iflp, LP_RMT_AS))
vty_out(vty, " neighbor %s as %u%s", inet_ntoa(iflp->rmt_ip),
iflp->rmt_as, VTY_NEWLINE);
+ vty_out(vty, " exit%s", VTY_NEWLINE);
return 0;
}
@@ -2786,13 +2787,20 @@
install_element(LINK_PARAMS_NODE, &link_params_max_rsv_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_unrsv_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_admin_grp_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_admin_grp_cmd);
install_element(LINK_PARAMS_NODE, &link_params_inter_as_cmd);
install_element(LINK_PARAMS_NODE, &no_link_params_inter_as_cmd);
install_element(LINK_PARAMS_NODE, &link_params_delay_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_delay_cmd);
install_element(LINK_PARAMS_NODE, &link_params_delay_mm_cmd);
install_element(LINK_PARAMS_NODE, &link_params_delay_var_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_delay_var_cmd);
install_element(LINK_PARAMS_NODE, &link_params_pkt_loss_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_pkt_loss_cmd);
install_element(LINK_PARAMS_NODE, &link_params_ava_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_ava_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_res_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_res_bw_cmd);
install_element(LINK_PARAMS_NODE, &link_params_use_bw_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_use_bw_cmd);
}