summaryrefslogtreecommitdiffstats
path: root/isisd/isisd.c
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2018-07-24 17:40:24 +0200
committerChristian Franke <chris@opensourcerouting.org>2018-08-03 13:25:39 +0200
commit3dace42de964a00429681544167679083b52807a (patch)
tree94d7cc43a4ac55777f739efd67c189033f8a730f /isisd/isisd.c
parentisisd: learn and advertise IPv6 dst-src routes (diff)
downloadfrr-3dace42de964a00429681544167679083b52807a.tar.xz
frr-3dace42de964a00429681544167679083b52807a.zip
isisd: move route_table into spftree
As isisd's route_tables are directly related to spf trees, move the route tables into the spftree instead of maintaining them alongside of the spftrees. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'isisd/isisd.c')
-rw-r--r--isisd/isisd.c64
1 files changed, 23 insertions, 41 deletions
diff --git a/isisd/isisd.c b/isisd/isisd.c
index cecaa0693..0094b30c2 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -118,13 +118,9 @@ struct isis_area *isis_area_create(const char *area_tag)
*/
if (area->is_type & IS_LEVEL_1) {
area->lspdb[0] = lsp_db_init();
- area->route_table[0] = route_table_init();
- area->route_table6[0] = route_table_init();
}
if (area->is_type & IS_LEVEL_2) {
area->lspdb[1] = lsp_db_init();
- area->route_table[1] = route_table_init();
- area->route_table6[1] = route_table_init();
}
spftree_area_init(area);
@@ -232,6 +228,10 @@ int isis_area_destroy(struct vty *vty, const char *area_tag)
area->lspdb[1] = NULL;
}
+ /* invalidate and verify to delete all routes from zebra */
+ isis_area_invalidate_routes(area, ISIS_LEVEL1 & ISIS_LEVEL2);
+ isis_area_verify_routes(area);
+
spftree_area_del(area);
THREAD_TIMER_OFF(area->spf_timer[0]);
@@ -240,27 +240,6 @@ int isis_area_destroy(struct vty *vty, const char *area_tag)
spf_backoff_free(area->spf_delay_ietf[0]);
spf_backoff_free(area->spf_delay_ietf[1]);
- /* invalidate and validate would delete all routes from zebra */
- isis_route_invalidate(area);
- isis_route_validate(area);
-
- if (area->route_table[0]) {
- route_table_finish(area->route_table[0]);
- area->route_table[0] = NULL;
- }
- if (area->route_table[1]) {
- route_table_finish(area->route_table[1]);
- area->route_table[1] = NULL;
- }
- if (area->route_table6[0]) {
- route_table_finish(area->route_table6[0]);
- area->route_table6[0] = NULL;
- }
- if (area->route_table6[1]) {
- route_table_finish(area->route_table6[1]);
- area->route_table6[1] = NULL;
- }
-
isis_redist_area_finish(area);
for (ALL_LIST_ELEMENTS(area->area_addrs, node, nnode, addr)) {
@@ -1680,8 +1659,27 @@ int isis_area_passwd_hmac_md5_set(struct isis_area *area, int level,
passwd, snp_auth);
}
+void isis_area_invalidate_routes(struct isis_area *area, int levels)
+{
+ for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
+ if (!(level & levels))
+ continue;
+ isis_spf_invalidate_routes(area->spftree[level - 1]);
+ isis_spf_invalidate_routes(area->spftree6[level - 1]);
+ }
+}
+
+void isis_area_verify_routes(struct isis_area *area)
+{
+ isis_spf_verify_routes(area, area->spftree);
+ isis_spf_verify_routes(area, area->spftree6);
+}
+
static void area_resign_level(struct isis_area *area, int level)
{
+ isis_area_invalidate_routes(area, level);
+ isis_area_verify_routes(area);
+
if (area->lspdb[level - 1]) {
lsp_db_destroy(area->lspdb[level - 1]);
area->lspdb[level - 1] = NULL;
@@ -1695,14 +1693,6 @@ static void area_resign_level(struct isis_area *area, int level)
area->spftree6[level - 1] = NULL;
}
THREAD_TIMER_OFF(area->spf_timer[level - 1]);
- if (area->route_table[level - 1]) {
- route_table_finish(area->route_table[level - 1]);
- area->route_table[level - 1] = NULL;
- }
- if (area->route_table6[level - 1]) {
- route_table_finish(area->route_table6[level - 1]);
- area->route_table6[level - 1] = NULL;
- }
sched_debug(
"ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.",
@@ -1731,10 +1721,6 @@ void isis_area_is_type_set(struct isis_area *area, int is_type)
if (area->lspdb[1] == NULL)
area->lspdb[1] = lsp_db_init();
- if (area->route_table[1] == NULL)
- area->route_table[1] = route_table_init();
- if (area->route_table6[1] == NULL)
- area->route_table6[1] = route_table_init();
break;
case IS_LEVEL_1_AND_2:
@@ -1750,10 +1736,6 @@ void isis_area_is_type_set(struct isis_area *area, int is_type)
if (area->lspdb[0] == NULL)
area->lspdb[0] = lsp_db_init();
- if (area->route_table[0] == NULL)
- area->route_table[0] = route_table_init();
- if (area->route_table6[0] == NULL)
- area->route_table6[0] = route_table_init();
break;
default: