diff options
| author | Alexander Chernavin <achernavin@netgate.com> | 2021-04-12 09:34:20 -0400 | 
|---|---|---|
| committer | Alexander Chernavin <achernavin@netgate.com> | 2021-04-12 09:34:20 -0400 | 
| commit | 1c1c342d2a22c9d600c36dde2d7d48c8b6b3ba41 (patch) | |
| tree | 05ee35120bdc534f86a8977a10e5409c5981a48a /ospfd/ospf_asbr.c | |
| parent | 53c42c82deb8e5ee882726c97e62b21e25b03b15 (diff) | |
ospfd: install Type-7 when NSSA area is configured after redistribution
Currently, if NSSA area is configured before redistribution is enabled,
Type-7 LSA's are installed and flooded. But if NSSA area is configured
after redistribution is enabled, Type-7 LSA's are not installed.
With this change, when NSSA area is configured, schedule a task that
scans for external LSA's. If they exist, install Type-7 and flood to
all NSSA Areas.
There already was an attempt to fix this problem in 0f321812f where
ospf_asbr_nssa_redist_task() was triggered in ospf_abr_task_timer().
This turns out to be incorrect place for this operation because it's
a one-off operation needed only after "area <ID> nssa" execution. And
ospf_abr_task_timer() is a periodic operation. Triggering
ospf_asbr_nssa_redist_task() in ospf_abr_task_timer() caused a problem
that was fixed in 945eec2b6 making the problem with NSSA area
configured after redistribution actual again.
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'ospfd/ospf_asbr.c')
| -rw-r--r-- | ospfd/ospf_asbr.c | 22 | 
1 files changed, 20 insertions, 2 deletions
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c index 0b4e5d7762..6d80725ae6 100644 --- a/ospfd/ospf_asbr.c +++ b/ospfd/ospf_asbr.c @@ -277,10 +277,16 @@ void ospf_asbr_status_update(struct ospf *ospf, uint8_t status)  /* If there's redistribution configured, we need to refresh external   * LSAs in order to install Type-7 and flood to all NSSA Areas   */ -void ospf_asbr_nssa_redist_task(struct ospf *ospf) +static int ospf_asbr_nssa_redist_update_timer(struct thread *thread)  { +	struct ospf *ospf = THREAD_ARG(thread);  	int type; +	ospf->t_asbr_nssa_redist_update = NULL; + +	if (IS_DEBUG_OSPF_EVENT) +		zlog_debug("Running ASBR NSSA redistribution update on timer"); +  	for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {  		struct list *red_list;  		struct listnode *node; @@ -293,10 +299,22 @@ void ospf_asbr_nssa_redist_task(struct ospf *ospf)  		for (ALL_LIST_ELEMENTS_RO(red_list, node, red))  			ospf_external_lsa_refresh_type(ospf, type,  						       red->instance, -						       LSA_REFRESH_IF_CHANGED); +						       LSA_REFRESH_FORCE);  	}  	ospf_external_lsa_refresh_default(ospf); + +	return 0; +} + +void ospf_schedule_asbr_nssa_redist_update(struct ospf *ospf) +{ +	if (IS_DEBUG_OSPF_EVENT) +		zlog_debug("Scheduling ASBR NSSA redistribution update"); + +	thread_add_timer(master, ospf_asbr_nssa_redist_update_timer, ospf, +			 OSPF_ASBR_NSSA_REDIST_UPDATE_DELAY, +			 &ospf->t_asbr_nssa_redist_update);  }  void ospf_redistribute_withdraw(struct ospf *ospf, uint8_t type,  | 
