summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_nssa.c
diff options
context:
space:
mode:
authorMobashshera Rasool <mrasool@vmware.com>2021-07-09 09:47:40 +0000
committerMobashshera Rasool <mrasool@vmware.com>2021-07-21 05:16:54 +0000
commitc3a70f651758d34d16f98c84f4daaf4488a277a9 (patch)
tree7a91b73fcb4b78ed266cde0d0edc2de86df24238 /ospf6d/ospf6_nssa.c
parent4dc43886914a1304b8331e0836a00f0eb605c7c9 (diff)
ospf6d: ASBR summarisation feature changes for NSSA area
1. ASBR summarisation for Type-7 LSAs are done here. 2. Fixed Code warnings Signed-off-by: Mobashshera Rasool<mrasool@vmware.com>
Diffstat (limited to 'ospf6d/ospf6_nssa.c')
-rw-r--r--ospf6d/ospf6_nssa.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c
index 9f8cdf8fb7..9810ccb498 100644
--- a/ospf6d/ospf6_nssa.c
+++ b/ospf6d/ospf6_nssa.c
@@ -1159,10 +1159,48 @@ static void ospf6_nssa_flush_area(struct ospf6_area *area)
}
}
-static void ospf6_area_nssa_update(struct ospf6_area *area)
+static void ospf6_check_and_originate_type7_lsa(struct ospf6_area *area)
{
- struct ospf6_route *route;
+ struct ospf6_route rt_aggr, *route;
+ struct route_node *rn = NULL;
+ struct ospf6_external_info ei_aggr;
+ struct ospf6_external_aggr_rt *aggr;
+
+ /* Loop through the external_table to find the LSAs originated
+ * without aggregation and originate type-7 LSAs for them.
+ */
+ for (route = ospf6_route_head(
+ area->ospf6->external_table);
+ route; route = ospf6_route_next(route)) {
+ /* This means the Type-5 LSA was originated for this route */
+ if (route->path.origin.id != 0)
+ ospf6_nssa_lsa_originate(route, area);
+
+ }
+
+ /* Loop through the aggregation table to originate type-7 LSAs
+ * for the aggregated type-5 LSAs
+ */
+ for (rn = route_top(area->ospf6->rt_aggr_tbl); rn;
+ rn = route_next(rn)) {
+ if (!rn->info)
+ continue;
+ aggr = rn->info;
+
+ if (CHECK_FLAG(aggr->aggrflags,
+ OSPF6_EXTERNAL_AGGRT_ORIGINATED)) {
+ /* Prepare the external_info for aggregator */
+ ospf6_fill_aggr_route_details(area->ospf6, &ei_aggr,
+ &rt_aggr, aggr);
+ ospf6_nssa_lsa_originate(&rt_aggr, area);
+ }
+ }
+
+}
+
+static void ospf6_area_nssa_update(struct ospf6_area *area)
+{
if (IS_AREA_NSSA(area)) {
if (!ospf6_check_and_set_router_abr(area->ospf6))
OSPF6_OPT_CLEAR(area->options, OSPF6_OPT_E);
@@ -1194,10 +1232,7 @@ static void ospf6_area_nssa_update(struct ospf6_area *area)
zlog_debug("NSSA area %s", area->name);
/* Originate NSSA LSA */
- for (route = ospf6_route_head(
- area->ospf6->external_table);
- route; route = ospf6_route_next(route))
- ospf6_nssa_lsa_originate(route, area);
+ ospf6_check_and_originate_type7_lsa(area);
}
} else {
/* Disable NSSA */