summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_nssa.c
diff options
context:
space:
mode:
authorManoj Naragund <mnaragund@vmware.com>2022-10-25 01:08:43 -0700
committerManoj Naragund <mnaragund@vmware.com>2022-11-14 04:47:08 -0800
commit27c233568527a30da219c034b5eb0eb2539cfb43 (patch)
tree344f398679decec7265203831311f1a9a459156b /ospf6d/ospf6_nssa.c
parent695f387ed872c1bc55ad4149ede95465b48697b9 (diff)
ospf6d: ospf6 route installation when changed from nssa to regular area.
Problem: Delay in ospfv3 route installation when area gets converted to regular from NSSA. RCA: when area gets converted from NSSA to normal the type-7(NSSA_LSAs) gets flushed from the area, as a result the external routes learnt from these type-7s gets removed. Once the area is moved to nomral the type 5 lsas needs to flooded through the area so that routes are re-learnt. however there is a delay in flooding of these routes until these routes are refreshed. Due to this there is delay installation of these routes. Fix: The Fix involves refreshing of the type 5 lsas once the area is changed from nssa to regular area. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
Diffstat (limited to 'ospf6d/ospf6_nssa.c')
-rw-r--r--ospf6d/ospf6_nssa.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c
index b1bff69f06..569e536e36 100644
--- a/ospf6d/ospf6_nssa.c
+++ b/ospf6d/ospf6_nssa.c
@@ -1092,7 +1092,25 @@ static void ospf6_check_and_originate_type7_lsa(struct ospf6_area *area)
ospf6_nssa_lsa_originate(aggr->route, area, true);
}
}
+}
+
+static void ospf6_ase_lsa_refresh(struct ospf6 *o)
+{
+ struct ospf6_lsa *old;
+ for (struct ospf6_route *route = ospf6_route_head(o->external_table);
+ route; route = ospf6_route_next(route)) {
+ old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL),
+ route->path.origin.id, o->router_id,
+ o->lsdb);
+ if (old) {
+ THREAD_OFF(old->refresh);
+ thread_add_event(master, ospf6_lsa_refresh, old, 0,
+ &old->refresh);
+ } else {
+ ospf6_as_external_lsa_originate(route, o);
+ }
+ }
}
void ospf6_area_nssa_update(struct ospf6_area *area)
@@ -1136,6 +1154,36 @@ void ospf6_area_nssa_update(struct ospf6_area *area)
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug("Normal area %s", area->name);
ospf6_nssa_flush_area(area);
+
+ /* Check if router is ABR */
+ if (ospf6_check_and_set_router_abr(area->ospf6)) {
+ if (IS_OSPF6_DEBUG_NSSA)
+ zlog_debug("Router is ABR area %s", area->name);
+ ospf6_schedule_abr_task(area->ospf6);
+ ospf6_ase_lsa_refresh(area->ospf6);
+ } else {
+ uint16_t type;
+ struct ospf6_lsa *lsa = NULL;
+
+ /*
+ * Refresh all type-5 LSAs so they get installed
+ * in the converted ares
+ */
+ if (IS_OSPF6_DEBUG_NSSA)
+ zlog_debug("Refresh type-5 LSAs, area %s",
+ area->name);
+
+ type = htons(OSPF6_LSTYPE_AS_EXTERNAL);
+ for (ALL_LSDB_TYPED_ADVRTR(area->ospf6->lsdb, type,
+ area->ospf6->router_id,
+ lsa)) {
+ if (IS_OSPF6_DEBUG_NSSA)
+ ospf6_lsa_header_print(lsa);
+ THREAD_OFF(lsa->refresh);
+ thread_add_event(master, ospf6_lsa_refresh, lsa,
+ 0, &lsa->refresh);
+ }
+ }
}
}