summaryrefslogtreecommitdiff
path: root/vrrpd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-13 18:30:06 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-10-25 15:31:07 +0300
commit104fd767383a042baff0eff8f3988d3a95123eda (patch)
tree0d37d85d14d727078fb4fdfecf4a677ad5e37b4e /vrrpd
parent6f354338f98c173dc9cdc9165c03acdf5fc5685e (diff)
*: fix interface config write in NB-converted daemons
When writing the config from the NB-converted daemon, we must not rely on the operational data. This commit changes the output of the interface configuration to use only config data. As the code is the same for all daemons, move it to the lib and remove all the duplicated code. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'vrrpd')
-rw-r--r--vrrpd/vrrp_vty.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c
index a612b0205a..c11254c71a 100644
--- a/vrrpd/vrrp_vty.c
+++ b/vrrpd/vrrp_vty.c
@@ -715,35 +715,6 @@ DEFUN_NOSH (show_debugging_vrrp,
/* clang-format on */
-/*
- * Write per interface VRRP config.
- */
-static int vrrp_config_write_interface(struct vty *vty)
-{
- struct vrf *vrf;
- int write = 0;
-
- RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
- struct interface *ifp;
-
- FOR_ALL_INTERFACES (vrf, ifp) {
- const struct lyd_node *dnode;
-
- dnode = yang_dnode_getf(
- running_config->dnode,
- "/frr-interface:lib/interface[name='%s'][vrf='%s']",
- ifp->name, vrf->name);
- if (dnode == NULL)
- continue;
-
- write = 1;
- nb_cli_show_dnode_cmds(vty, dnode, false);
- }
- }
-
- return write;
-}
-
static struct cmd_node debug_node = {
.name = "debug",
.node = DEBUG_NODE,
@@ -763,7 +734,7 @@ void vrrp_vty_init(void)
install_node(&debug_node);
install_node(&vrrp_node);
vrf_cmd_init(NULL);
- if_cmd_init(vrrp_config_write_interface);
+ if_cmd_init_default();
install_element(VIEW_NODE, &vrrp_vrid_show_cmd);
install_element(VIEW_NODE, &vrrp_vrid_show_summary_cmd);