summaryrefslogtreecommitdiff
path: root/isisd/isis_vty_fabricd.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-04-28 01:57:21 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-04-29 17:05:21 +0300
commitbcf220815632500f9646cb0b4c13f498afa4edf6 (patch)
treec886adf613df11059b980959086bd59c3491f013 /isisd/isis_vty_fabricd.c
parent0fdd8b2b115d1aaa73f483aa8bdec619c036338b (diff)
isisd: allow arbitrary order of area/interface configuration
Currently we don't allow to configure the interface before the area is configured. This approach has the following issues: 1. The area config can be deleted even when we have an interface config relying on it. The code is not ready for that - we'll have a whole bunch of stale pointers if user does that. 2. The code doesn't correctly process the event of changing the VRF for an interface. There is no mechanism to ensure that the area exists in the new VRF so currently the circuit still stays in the old VRF. This commit allows an arbitrary order of area/interface configuration. There is no more need to configure the area before configuring the interface. This change fixes both the issues. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'isisd/isis_vty_fabricd.c')
-rw-r--r--isisd/isis_vty_fabricd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/isisd/isis_vty_fabricd.c b/isisd/isis_vty_fabricd.c
index 6055984195..7020b6efeb 100644
--- a/isisd/isis_vty_fabricd.c
+++ b/isisd/isis_vty_fabricd.c
@@ -229,10 +229,10 @@ DEFUN (ip_router_isis,
area = isis_area_lookup(area_tag, VRF_DEFAULT);
if (!area)
- area = isis_area_create(area_tag, VRF_DEFAULT_NAME);
+ isis_area_create(area_tag, VRF_DEFAULT_NAME);
- if (!circuit || !circuit->area) {
- circuit = isis_circuit_create(area, ifp);
+ if (!circuit) {
+ circuit = isis_circuit_new(ifp, area_tag);
if (circuit->state != C_STATE_CONF
&& circuit->state != C_STATE_UP) {
@@ -288,7 +288,7 @@ DEFUN (no_ip_router_isis,
return CMD_ERR_NO_MATCH;
}
- circuit = circuit_lookup_by_ifp(ifp, area->circuit_list);
+ circuit = circuit_scan_by_ifp(ifp);
if (!circuit) {
vty_out(vty, "ISIS is not enabled on circuit %s\n", ifp->name);
return CMD_ERR_NO_MATCH;
@@ -301,6 +301,10 @@ DEFUN (no_ip_router_isis,
ip = false;
isis_circuit_af_set(circuit, ip, ipv6);
+
+ if (!ip && !ipv6)
+ isis_circuit_del(circuit);
+
return CMD_SUCCESS;
}