diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-13 18:30:06 +0300 | 
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-25 15:31:07 +0300 | 
| commit | 104fd767383a042baff0eff8f3988d3a95123eda (patch) | |
| tree | 0d37d85d14d727078fb4fdfecf4a677ad5e37b4e /ripd/rip_interface.c | |
| parent | 6f354338f98c173dc9cdc9165c03acdf5fc5685e (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 'ripd/rip_interface.c')
| -rw-r--r-- | ripd/rip_interface.c | 29 | 
1 files changed, 1 insertions, 28 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 2eb7bb6da1..3d128ee727 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1103,33 +1103,6 @@ void rip_passive_nondefault_clean(struct rip *rip)  	rip_passive_interface_apply_all(rip);  } -/* Write rip configuration of each interface. */ -static int rip_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; -} -  int rip_show_network_config(struct vty *vty, struct rip *rip)  {  	unsigned int i; @@ -1194,7 +1167,7 @@ void rip_if_init(void)  	hook_register_prio(if_del, 0, rip_interface_delete_hook);  	/* Install interface node. */ -	if_cmd_init(rip_interface_config_write); +	if_cmd_init_default();  	if_zapi_callbacks(rip_ifp_create, rip_ifp_up,  			  rip_ifp_down, rip_ifp_destroy);  }  | 
