diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-07-06 12:55:03 -0400 | 
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-10-23 08:59:34 -0400 | 
| commit | b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (patch) | |
| tree | b5ef6dcab41d9da516a6ff044056e0faca7b35da /isisd/fabricd.c | |
| parent | 90a65457d12d8d90bf47eab1a4bb5446b3810d96 (diff) | |
* : update signature of thread_cancel api
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'isisd/fabricd.c')
| -rw-r--r-- | isisd/fabricd.c | 27 | 
1 files changed, 8 insertions, 19 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c index 1a081bbea6..57e9e91c15 100644 --- a/isisd/fabricd.c +++ b/isisd/fabricd.c @@ -239,14 +239,11 @@ struct fabricd *fabricd_new(struct isis_area *area)  void fabricd_finish(struct fabricd *f)  { -	if (f->initial_sync_timeout) -		thread_cancel(f->initial_sync_timeout); +	thread_cancel(&(f->initial_sync_timeout)); -	if (f->tier_calculation_timer) -		thread_cancel(f->tier_calculation_timer); +	thread_cancel(&(f->tier_calculation_timer)); -	if (f->tier_set_timer) -		thread_cancel(f->tier_set_timer); +	thread_cancel(&(f->tier_set_timer));  	isis_spftree_del(f->spftree);  	neighbor_lists_clear(f); @@ -340,8 +337,7 @@ void fabricd_initial_sync_finish(struct isis_area *area)  		  f->initial_sync_circuit->interface->name);  	f->initial_sync_state = FABRICD_SYNC_COMPLETE;  	f->initial_sync_circuit = NULL; -	thread_cancel(f->initial_sync_timeout); -	f->initial_sync_timeout = NULL; +	thread_cancel(&(f->initial_sync_timeout));  }  static void fabricd_bump_tier_calculation_timer(struct fabricd *f); @@ -437,22 +433,15 @@ static int fabricd_tier_calculation_cb(struct thread *thread)  static void fabricd_bump_tier_calculation_timer(struct fabricd *f)  {  	/* Cancel timer if we already know our tier */ -	if (f->tier != ISIS_TIER_UNDEFINED -	    || f->tier_set_timer) { -		if (f->tier_calculation_timer) { -			thread_cancel(f->tier_calculation_timer); -			f->tier_calculation_timer = NULL; -		} +	if (f->tier != ISIS_TIER_UNDEFINED || f->tier_set_timer) { +		thread_cancel(&(f->tier_calculation_timer));  		return;  	}  	/* If we need to calculate the tier, wait some  	 * time for the topology to settle before running  	 * the calculation */ -	if (f->tier_calculation_timer) { -		thread_cancel(f->tier_calculation_timer); -		f->tier_calculation_timer = NULL; -	} +	thread_cancel(&(f->tier_calculation_timer));  	thread_add_timer(master, fabricd_tier_calculation_cb, f,  			 2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1], @@ -737,7 +726,7 @@ void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped)  		if (!circuit->t_send_csnp[1])  			continue; -		thread_cancel(circuit->t_send_csnp[ISIS_LEVEL2 - 1]); +		thread_cancel(&(circuit->t_send_csnp[ISIS_LEVEL2 - 1]));  		thread_add_timer_msec(master, send_l2_csnp, circuit,  				      isis_jitter(f->csnp_delay, CSNP_JITTER),  				      &circuit->t_send_csnp[ISIS_LEVEL2 - 1]);  | 
