diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-30 03:15:24 +0300 | 
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-30 03:17:49 +0300 | 
| commit | 2f9a06f0600b6d1c6f28117bb2846ce3675fc129 (patch) | |
| tree | 86b32a67b482bc9f1157c98c2b194c6f209604f7 /isisd/isis_circuit.c | |
| parent | 6b1801a499d184cb21f3991f380f480fe10f5856 (diff) | |
isisd: fix circuit is-type configuration
Currently, we have a lot of checks in CLI and NB layer to prevent
incompatible IS-types of circuits and areas. All these checks become
completely meaningless when the interface is moved between VRFs. If the
area IS-type is different in the new VRF, previously done checks mean
nothing and we still end up with incorrect circuit IS type. To actually
prevent incorrect IS type, all checks must be done in the processing
code.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'isisd/isis_circuit.c')
| -rw-r--r-- | isisd/isis_circuit.c | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index c09bdf4f4f..8810d6107d 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -116,7 +116,7 @@ struct isis_circuit *isis_circuit_new(struct interface *ifp, const char *tag)  	 * Default values  	 */  #ifndef FABRICD -	circuit->is_type = yang_get_default_enum( +	circuit->is_type_config = yang_get_default_enum(  		"/frr-interface:lib/interface/frr-isisd:isis/circuit-type");  	circuit->flags = 0; @@ -156,7 +156,7 @@ struct isis_circuit *isis_circuit_new(struct interface *ifp, const char *tag)  		circuit->level_arg[i].circuit = circuit;  	}  #else -	circuit->is_type = IS_LEVEL_1_AND_2; +	circuit->is_type_config = IS_LEVEL_1_AND_2;  	circuit->flags = 0;  	circuit->pad_hellos = 1;  	for (i = 0; i < 2; i++) { @@ -172,6 +172,8 @@ struct isis_circuit *isis_circuit_new(struct interface *ifp, const char *tag)  	}  #endif /* ifndef FABRICD */ +	circuit->is_type = circuit->is_type_config; +  	circuit_mt_init(circuit);  	isis_lfa_excluded_ifaces_init(circuit, ISIS_LEVEL1);  	isis_lfa_excluded_ifaces_init(circuit, ISIS_LEVEL2); @@ -253,6 +255,10 @@ void isis_circuit_deconfigure(struct isis_circuit *circuit,  	/* Free the index of SRM and SSN flags */  	flags_free_index(&area->flags, circuit->idx);  	circuit->idx = 0; + +	/* Reset IS type to configured */ +	circuit->is_type = circuit->is_type_config; +  	/* Remove circuit from area */  	assert(circuit->area == area);  	listnode_delete(area->circuit_list, circuit);  | 
