diff options
| author | Russ White <russ@riw.us> | 2021-07-30 06:37:50 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-30 06:37:50 -0400 | 
| commit | e448fefbb4adf12581c002f658e03378a01b7940 (patch) | |
| tree | 897de52057295df435d9880fe047bb2f8087789b /ospf6d/ospf6_nssa.c | |
| parent | 6430836d92dd6c695241ae9fc1ba72d69f2e6906 (diff) | |
| parent | 8a86be272fab9fc6af73a10b386e45583601fad9 (diff) | |
Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisation
Ospfv3 ASBR summarisation feature
Diffstat (limited to 'ospf6d/ospf6_nssa.c')
| -rw-r--r-- | ospf6d/ospf6_nssa.c | 46 | 
1 files changed, 41 insertions, 5 deletions
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c index 34d17941f4..470a5b1338 100644 --- a/ospf6d/ospf6_nssa.c +++ b/ospf6d/ospf6_nssa.c @@ -1159,10 +1159,49 @@ 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 route_node *rn = NULL; +	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)) { +			if (IS_OSPF6_DEBUG_NSSA) +				zlog_debug( +					"Originating Type-7 LSAs for area %s", +					area->name); + +			ospf6_nssa_lsa_originate(aggr->route, 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 +1233,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 */  | 
