diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-13 17:30:06 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-25 14:31:07 +0200 |
commit | 104fd767383a042baff0eff8f3988d3a95123eda (patch) | |
tree | 0d37d85d14d727078fb4fdfecf4a677ad5e37b4e /ripngd/ripng_interface.c | |
parent | Merge pull request #9824 from idryzhov/nb-cli-const-lyd-node (diff) | |
download | frr-104fd767383a042baff0eff8f3988d3a95123eda.tar.xz frr-104fd767383a042baff0eff8f3988d3a95123eda.zip |
*: 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 'ripngd/ripng_interface.c')
-rw-r--r-- | ripngd/ripng_interface.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 7b5e7604d..dc577facc 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -923,33 +923,6 @@ static int ripng_if_delete_hook(struct interface *ifp) return 0; } -/* Configuration write function for ripngd. */ -static int interface_config_write(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) { - 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; -} - /* Initialization of interface. */ void ripng_if_init(void) { @@ -958,7 +931,7 @@ void ripng_if_init(void) hook_register_prio(if_del, 0, ripng_if_delete_hook); /* Install interface node. */ - if_cmd_init(interface_config_write); + if_cmd_init_default(); if_zapi_callbacks(ripng_ifp_create, ripng_ifp_up, ripng_ifp_down, ripng_ifp_destroy); } |