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 /isisd/isis_circuit.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 'isisd/isis_circuit.c')
| -rw-r--r-- | isisd/isis_circuit.c | 28 | 
1 files changed, 4 insertions, 24 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 6f4a91be67..c09bdf4f4f 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -1295,30 +1295,6 @@ static int isis_interface_config_write(struct vty *vty)  	return write;  } -#else -static int isis_interface_config_write(struct vty *vty) -{ -	struct vrf *vrf = NULL; -	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++; -			nb_cli_show_dnode_cmds(vty, dnode, false); -		} -	} -	return write; -}  #endif /* ifdef FABRICD */  void isis_circuit_af_set(struct isis_circuit *circuit, bool ip_router, @@ -1529,7 +1505,11 @@ void isis_circuit_init(void)  	hook_register_prio(if_del, 0, isis_if_delete_hook);  	/* Install interface node */ +#ifdef FABRICD  	if_cmd_init(isis_interface_config_write); +#else +	if_cmd_init_default(); +#endif  	if_zapi_callbacks(isis_ifp_create, isis_ifp_up,  			  isis_ifp_down, isis_ifp_destroy);  }  | 
