@@ -929,7 +929,7 @@ void bgp_start_tier2_deferral_timer(struct bgp *bgp, afi_t afi, safi_t safi)
929929 /*
930930 * tier-2 deferral timer is already running
931931 */
932- if (gr_info -> t_select_deferral_tier2 ) {
932+ if (event_is_scheduled ( gr_info -> t_select_deferral_tier2 ) ) {
933933 if (BGP_DEBUG (graceful_restart , GRACEFUL_RESTART ))
934934 zlog_debug ("%s: tier-2 path-select deferral timer for %s, duration %d is running" ,
935935 bgp -> name_pretty , get_afi_safi_str (afi , safi , false),
@@ -1022,7 +1022,7 @@ static bool bgp_update_delay_applicable(struct bgp *bgp)
10221022
10231023bool bgp_update_delay_active (struct bgp * bgp )
10241024{
1025- if (bgp -> t_update_delay )
1025+ if (event_is_scheduled ( bgp -> t_update_delay ) )
10261026 return true;
10271027 return false;
10281028}
@@ -1046,7 +1046,7 @@ bool bgp_advertisement_delay_applicable(struct bgp *bgp)
10461046
10471047bool bgp_advertisement_delay_active (struct bgp * bgp )
10481048{
1049- if (bgp -> t_advertisement_delay )
1049+ if (event_is_scheduled ( bgp -> t_advertisement_delay ) )
10501050 return true;
10511051 return false;
10521052}
@@ -1208,7 +1208,7 @@ void bgp_adjust_routeadv(struct peer *peer)
12081208 *
12091209 * (MRAI - m) < r
12101210 */
1211- if (connection -> t_routeadv )
1211+ if (event_is_scheduled ( connection -> t_routeadv ) )
12121212 remain = event_timer_remain_second (connection -> t_routeadv );
12131213 else
12141214 remain = peer -> v_routeadv ;
@@ -1235,7 +1235,7 @@ bool bgp_maxmed_onstartup_configured(struct bgp *bgp)
12351235
12361236bool bgp_maxmed_onstartup_active (struct bgp * bgp )
12371237{
1238- if (bgp -> t_maxmed_onstartup )
1238+ if (event_is_scheduled ( bgp -> t_maxmed_onstartup ) )
12391239 return true;
12401240 return false;
12411241}
@@ -1248,7 +1248,7 @@ void bgp_maxmed_update(struct bgp *bgp)
12481248 if (bgp -> v_maxmed_admin ) {
12491249 maxmed_active = 1 ;
12501250 maxmed_value = bgp -> maxmed_admin_value ;
1251- } else if (bgp -> t_maxmed_onstartup ) {
1251+ } else if (event_is_scheduled ( bgp -> t_maxmed_onstartup ) ) {
12521252 maxmed_active = 1 ;
12531253 maxmed_value = bgp -> maxmed_onstartup_value ;
12541254 } else {
@@ -1673,7 +1673,7 @@ void bgp_gr_check_path_select(struct bgp *bgp, afi_t afi, safi_t safi)
16731673 */
16741674 if (!BGP_SUPPRESS_FIB_ENABLED (bgp ) || !bgp -> gr_info [afi ][safi ].gr_deferred ||
16751675 !bgp_fibupd_safi (safi )) {
1676- if (gr_info -> t_select_deferral ) {
1676+ if (event_is_scheduled ( gr_info -> t_select_deferral ) ) {
16771677 void * info = EVENT_ARG (gr_info -> t_select_deferral );
16781678
16791679 XFREE (MTYPE_TMP , info );
@@ -1686,7 +1686,7 @@ void bgp_gr_check_path_select(struct bgp *bgp, afi_t afi, safi_t safi)
16861686 * then cancel the timer.
16871687 */
16881688 if (!multihop_eors_pending ) {
1689- if (gr_info -> t_select_deferral_tier2 ) {
1689+ if (event_is_scheduled ( gr_info -> t_select_deferral_tier2 ) ) {
16901690 void * info = EVENT_ARG (gr_info -> t_select_deferral_tier2 );
16911691
16921692 XFREE (MTYPE_TMP , info );
@@ -1858,7 +1858,7 @@ void bgp_gr_start_all_deferral_timers(struct bgp *bgp)
18581858 continue ;
18591859
18601860 gr_info = & (bgp -> gr_info [afi ][safi ]);
1861- if (!gr_info -> t_select_deferral )
1861+ if (!event_is_scheduled ( gr_info -> t_select_deferral ) )
18621862 bgp_start_deferral_timer (bgp , afi , safi , gr_info );
18631863 }
18641864}
@@ -1904,7 +1904,8 @@ static void bgp_gr_process_peer_up_include(struct bgp *bgp, struct peer *peer)
19041904 } else {
19051905 SET_FLAG (peer -> af_sflags [afi ][safi ], PEER_STATUS_GR_WAIT_EOR );
19061906 gr_info = & (bgp -> gr_info [afi ][safi ]);
1907- if (!gr_info -> t_select_deferral && !gr_info -> select_defer_over )
1907+ if (!event_is_scheduled (gr_info -> t_select_deferral ) &&
1908+ !gr_info -> select_defer_over )
19081909 bgp_start_deferral_timer (bgp , afi , safi , gr_info );
19091910 }
19101911 }
@@ -1974,7 +1975,7 @@ static bool gr_path_select_deferral_applicable(struct bgp *bgp)
19741975 * settings and GR is not complete and path selection
19751976 * deferral not yet done for this instance
19761977 */
1977- if (!bgp -> t_startup && !bgp_in_graceful_restart ())
1978+ if (!event_is_scheduled ( bgp -> t_startup ) && !bgp_in_graceful_restart ())
19781979 return false;
19791980
19801981 FOREACH_AFI_SAFI_NSF (afi , safi ) {
@@ -2183,7 +2184,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection)
21832184 }
21842185
21852186 /* graceful restart */
2186- if (connection -> t_gr_stale ) {
2187+ if (event_is_scheduled ( connection -> t_gr_stale ) ) {
21872188 event_cancel (& connection -> t_gr_stale );
21882189 if (bgp_debug_neighbor_events (peer ))
21892190 zlog_debug ("%pBP graceful restart stalepath timer stopped for %s" ,
@@ -2212,7 +2213,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection)
22122213 }
22132214
22142215 /* Stop route-refresh stalepath timer */
2215- if (peer -> t_refresh_stalepath ) {
2216+ if (event_is_scheduled ( peer -> t_refresh_stalepath ) ) {
22162217 event_cancel (& peer -> t_refresh_stalepath );
22172218
22182219 if (bgp_debug_neighbor_events (peer ))
@@ -2551,7 +2552,7 @@ bgp_connect_success_w_delayopen(struct peer_connection *connection)
25512552 peer -> v_delayopen = peer -> delayopen ;
25522553
25532554 /* Start the DelayOpenTimer if it is not already running */
2554- if (!connection -> t_delayopen )
2555+ if (!event_is_scheduled ( connection -> t_delayopen ) )
25552556 BGP_TIMER_ON (connection -> t_delayopen , bgp_delayopen_timer , peer -> v_delayopen );
25562557
25572558 frrtrace (2 , frr_bgp , session_state_change , peer , 6 );
@@ -2837,7 +2838,7 @@ static void bgp_peer_process_gr_cap_clear_stale(struct peer *peer)
28372838 safi_t safi ;
28382839 int nsf_af_count = 0 ;
28392840
2840- if (peer -> connection -> t_gr_restart ) {
2841+ if (event_is_scheduled ( peer -> connection -> t_gr_restart ) ) {
28412842 event_cancel (& peer -> connection -> t_gr_restart );
28422843 if (bgp_debug_neighbor_events (peer ))
28432844 zlog_debug ("%pBP: graceful restart timer stopped" , peer );
@@ -2880,7 +2881,7 @@ static void bgp_peer_process_gr_cap_clear_stale(struct peer *peer)
28802881 SET_FLAG (peer -> sflags , PEER_STATUS_NSF_MODE );
28812882 else {
28822883 UNSET_FLAG (peer -> sflags , PEER_STATUS_NSF_MODE );
2883- if (peer -> connection -> t_gr_stale ) {
2884+ if (event_is_scheduled ( peer -> connection -> t_gr_stale ) ) {
28842885 event_cancel (& peer -> connection -> t_gr_stale );
28852886 if (bgp_debug_neighbor_events (peer ))
28862887 zlog_debug ("%s: graceful restart stalepath timer stopped" ,
@@ -2977,7 +2978,7 @@ bgp_establish(struct peer_connection *connection)
29772978 * Stop Long-lived Graceful Restart timers.
29782979 */
29792980 FOREACH_AFI_SAFI (afi , safi ) {
2980- if (peer -> t_llgr_stale [afi ][safi ]) {
2981+ if (event_is_scheduled ( peer -> t_llgr_stale [afi ][safi ]) ) {
29812982 event_cancel (& peer -> t_llgr_stale [afi ][safi ]);
29822983 if (bgp_debug_neighbor_events (peer ))
29832984 zlog_debug ("%pBP Long-lived stale timer stopped for afi/safi: %d/%d for %s" ,
0 commit comments