*: Convert thread_timer_remain_XXX to event_timer_remain_XXX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2022-12-11 08:19:00 -05:00
parent 8c1186d38e
commit 4f830a0799
25 changed files with 85 additions and 87 deletions

View File

@ -2408,7 +2408,7 @@ DEFPY(show_bmp,
uptime[0] = '\0';
if (ba->t_timer) {
long trem = thread_timer_remain_second(
long trem = event_timer_remain_second(
ba->t_timer);
peer_uptime(monotime(NULL) - trem,

View File

@ -1046,7 +1046,7 @@ void bgp_adjust_routeadv(struct peer *peer)
* (MRAI - m) < r
*/
if (peer->t_routeadv)
remain = thread_timer_remain_second(peer->t_routeadv);
remain = event_timer_remain_second(peer->t_routeadv);
else
remain = peer->v_routeadv;
diff = peer->v_routeadv - diff;

View File

@ -11105,7 +11105,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
if (path->peer->t_gr_restart &&
CHECK_FLAG(path->flags, BGP_PATH_STALE)) {
unsigned long gr_remaining =
thread_timer_remain_second(path->peer->t_gr_restart);
event_timer_remain_second(path->peer->t_gr_restart);
if (json_paths) {
json_object_int_add(json_path,
@ -11121,7 +11121,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
bgp_attr_get_community(attr) &&
community_include(bgp_attr_get_community(attr),
COMMUNITY_LLGR_STALE)) {
unsigned long llgr_remaining = thread_timer_remain_second(
unsigned long llgr_remaining = event_timer_remain_second(
path->peer->t_llgr_stale[afi][safi]);
if (json_paths) {

View File

@ -12330,7 +12330,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
if (peer->t_gr_stale != NULL) {
json_object_int_add(json_timer,
"stalePathTimerRemaining",
thread_timer_remain_second(
event_timer_remain_second(
peer->t_gr_stale));
}
@ -12351,7 +12351,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
json_object_int_add(
json_timer,
"selectionDeferralTimerRemaining",
thread_timer_remain_second(
event_timer_remain_second(
peer->bgp->gr_info[afi][safi]
.t_select_deferral));
}
@ -12364,7 +12364,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
if (peer->t_gr_stale != NULL)
vty_out(vty,
" Stale Path Remaining(sec): %ld\n",
thread_timer_remain_second(
event_timer_remain_second(
peer->t_gr_stale));
/* Display Configured Selection
* Deferral only when when
@ -12379,7 +12379,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
NULL)
vty_out(vty,
" Selection Deferral Time Remaining(sec): %ld\n",
thread_timer_remain_second(
event_timer_remain_second(
peer->bgp->gr_info[afi][safi]
.t_select_deferral));
}
@ -12413,7 +12413,7 @@ static void bgp_show_neighbor_graceful_restart_time(struct vty *vty,
if (p->t_gr_restart != NULL)
json_object_int_add(
json_timer, "restartTimerRemaining",
thread_timer_remain_second(p->t_gr_restart));
event_timer_remain_second(p->t_gr_restart));
json_object_object_add(json, "timers", json_timer);
} else {
@ -12426,10 +12426,10 @@ static void bgp_show_neighbor_graceful_restart_time(struct vty *vty,
p->v_gr_restart);
if (p->t_gr_restart != NULL)
vty_out(vty, " Restart Time Remaining(sec): %ld\n",
thread_timer_remain_second(p->t_gr_restart));
event_timer_remain_second(p->t_gr_restart));
if (p->t_gr_restart != NULL) {
vty_out(vty, " Restart Time Remaining(sec): %ld\n",
thread_timer_remain_second(p->t_gr_restart));
event_timer_remain_second(p->t_gr_restart));
}
}
}
@ -13464,7 +13464,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
json_object_int_add(
json_neigh,
"bgpTimerUntilConditionalAdvertisementsSec",
thread_timer_remain_second(
event_timer_remain_second(
bgp->t_condition_check));
} else {
/* Administrative shutdown. */
@ -13544,7 +13544,7 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
if (thread_is_scheduled(bgp->t_condition_check))
vty_out(vty,
" Time until conditional advertisements begin is %lu seconds\n",
thread_timer_remain_second(
event_timer_remain_second(
bgp->t_condition_check));
}
/* Capability. */
@ -14481,13 +14481,13 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
if (p->t_gr_restart)
json_object_int_add(
json_grace, "gracefulRestartTimerMsecs",
thread_timer_remain_second(p->t_gr_restart) *
event_timer_remain_second(p->t_gr_restart) *
1000);
if (p->t_gr_stale)
json_object_int_add(
json_grace, "gracefulStalepathTimerMsecs",
thread_timer_remain_second(p->t_gr_stale) *
event_timer_remain_second(p->t_gr_stale) *
1000);
/* more gr info in new format */
BGP_SHOW_PEER_GR_CAPABILITY(vty, p, json_grace);
@ -14528,12 +14528,12 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
if (p->t_gr_restart)
vty_out(vty,
" The remaining time of restart timer is %ld\n",
thread_timer_remain_second(p->t_gr_restart));
event_timer_remain_second(p->t_gr_restart));
if (p->t_gr_stale)
vty_out(vty,
" The remaining time of stalepath timer is %ld\n",
thread_timer_remain_second(p->t_gr_stale));
event_timer_remain_second(p->t_gr_stale));
/* more gr info in new format */
BGP_SHOW_PEER_GR_CAPABILITY(vty, p, NULL);
@ -14767,14 +14767,15 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
json_neigh, "reducePrefixNumFrom");
json_object_int_add(json_neigh,
"restartInTimerMsec",
thread_timer_remain_second(
p->t_pmax_restart)
* 1000);
event_timer_remain_second(
p->t_pmax_restart) *
1000);
} else
vty_out(vty,
" Reduce the no. of prefix from %s, will restart in %ld seconds\n",
p->host, thread_timer_remain_second(
p->t_pmax_restart));
p->host,
event_timer_remain_second(
p->t_pmax_restart));
} else {
if (use_json)
json_object_boolean_true_add(
@ -14926,19 +14927,18 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
if (p->t_start)
json_object_int_add(
json_neigh, "nextStartTimerDueInMsecs",
thread_timer_remain_second(p->t_start) * 1000);
event_timer_remain_second(p->t_start) * 1000);
if (p->t_connect)
json_object_int_add(
json_neigh, "nextConnectTimerDueInMsecs",
thread_timer_remain_second(p->t_connect)
* 1000);
event_timer_remain_second(p->t_connect) * 1000);
if (p->t_routeadv) {
json_object_int_add(json_neigh, "mraiInterval",
p->v_routeadv);
json_object_int_add(
json_neigh, "mraiTimerExpireInMsecs",
thread_timer_remain_second(p->t_routeadv)
* 1000);
event_timer_remain_second(p->t_routeadv) *
1000);
}
if (p->password)
json_object_int_add(json_neigh, "authenticationEnabled",
@ -14967,15 +14967,15 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
}
if (p->t_start)
vty_out(vty, "Next start timer due in %ld seconds\n",
thread_timer_remain_second(p->t_start));
event_timer_remain_second(p->t_start));
if (p->t_connect)
vty_out(vty, "Next connect timer due in %ld seconds\n",
thread_timer_remain_second(p->t_connect));
event_timer_remain_second(p->t_connect));
if (p->t_routeadv)
vty_out(vty,
"MRAI (interval %u) timer expires in %ld seconds\n",
p->v_routeadv,
thread_timer_remain_second(p->t_routeadv));
event_timer_remain_second(p->t_routeadv));
if (p->password)
vty_out(vty, "Peer Authentication Enabled\n");
@ -18798,7 +18798,7 @@ static void bgp_config_end(void)
#define BGP_POST_CONFIG_DELAY_SECONDS 1
uint32_t bgp_post_config_delay =
thread_is_scheduled(bm->t_rmap_update)
? thread_timer_remain_second(bm->t_rmap_update)
? event_timer_remain_second(bm->t_rmap_update)
: BGP_POST_CONFIG_DELAY_SECONDS;
/* If BGP config processing thread isn't running, then

View File

@ -743,7 +743,7 @@ static void rfapiMonitorTimerExpire(struct event *t)
static void rfapiMonitorTimerRestart(struct rfapi_monitor_vpn *m)
{
unsigned long remain = thread_timer_remain_second(m->timer);
unsigned long remain = event_timer_remain_second(m->timer);
/* unexpected case, but avoid wraparound problems below */
if (remain > m->rfd->response_lifetime)
@ -1051,7 +1051,7 @@ static void rfapiMonitorEthTimerExpire(struct event *t)
static void rfapiMonitorEthTimerRestart(struct rfapi_monitor_eth *m)
{
unsigned long remain = thread_timer_remain_second(m->timer);
unsigned long remain = event_timer_remain_second(m->timer);
/* unexpected case, but avoid wraparound problems below */
if (remain > m->rfd->response_lifetime)

View File

@ -518,7 +518,7 @@ void rfapiPrintBi(void *stream, struct bgp_path_info *bpi)
&& bpi->extra->vnc.import.timer) {
struct event *t = (struct event *)bpi->extra->vnc.import.timer;
r = snprintf(p, REMAIN, " [%4lu] ",
thread_timer_remain_second(t));
event_timer_remain_second(t));
INCP;
} else {
@ -909,7 +909,7 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
fp(out, "%-15s %-15s", "", "");
buf_remain[0] = 0;
rfapiFormatSeconds(
thread_timer_remain_second(m->timer),
event_timer_remain_second(m->timer),
buf_remain, BUFSIZ);
fp(out, " %-15s %-10s\n",
inet_ntop(m->p.family, &m->p.u.prefix,
@ -982,7 +982,7 @@ int rfapiShowVncQueries(void *stream, struct prefix *pfx_match)
} else
fp(out, "%-15s %-15s", "", "");
buf_remain[0] = 0;
rfapiFormatSeconds(thread_timer_remain_second(
rfapiFormatSeconds(event_timer_remain_second(
mon_eth->timer),
buf_remain, BUFSIZ);
fp(out, " %-17s %10d %-10s\n",
@ -1114,7 +1114,7 @@ static int rfapiPrintRemoteRegBi(struct bgp *bgp, void *stream,
char buf_age[BUFSIZ];
struct event *t = (struct event *)bpi->extra->vnc.import.timer;
remaining = thread_timer_remain_second(t);
remaining = event_timer_remain_second(t);
#ifdef RFAPI_REGISTRATIONS_REPORT_AGE
/*

View File

@ -192,7 +192,7 @@ void show_ip_eigrp_neighbor_sub(struct vty *vty, struct eigrp_neighbor *nbr,
vty_out(vty, "%-3u %-17pI4 %-21s", 0, &nbr->src, IF_NAME(nbr->ei));
if (nbr->t_holddown)
vty_out(vty, "%-7lu",
thread_timer_remain_second(nbr->t_holddown));
event_timer_remain_second(nbr->t_holddown));
else
vty_out(vty, "- ");
vty_out(vty, "%-8u %-6u %-5u", 0, 0, EIGRP_PACKET_RETRANS_TIME);

View File

@ -575,8 +575,8 @@ static void isis_circuit_ldp_sync_print_vty(struct isis_circuit *circuit,
break;
case LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP:
if (ldp_sync_info->t_holddown != NULL) {
struct timeval remain = thread_timer_remain(
ldp_sync_info->t_holddown);
struct timeval remain =
event_timer_remain(ldp_sync_info->t_holddown);
vty_out(vty,
" Holddown timer is running %lld.%03lld remaining\n",
(long long)remain.tv_sec,

View File

@ -1603,7 +1603,7 @@ int _lsp_regenerate_schedule(struct isis_area *area, int level,
* Note: in case of a BFD 'down' message the refresh is
* scheduled once again just to be sure
*/
struct timeval remain = thread_timer_remain(
struct timeval remain = event_timer_remain(
area->t_lsp_refresh[lvl - 1]);
sched_debug(
"ISIS (%s): Regeneration is already pending, nothing todo. (Due in %lld.%03lld seconds)",
@ -1986,7 +1986,7 @@ int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level)
}
if (circuit->lsp_regenerate_pending[lvl - 1]) {
struct timeval remain = thread_timer_remain(
struct timeval remain = event_timer_remain(
circuit->u.bc.t_refresh_pseudo_lsp[lvl - 1]);
sched_debug(
"ISIS (%s): Regenerate is already pending, nothing todo. (Due in %lld.%03lld seconds)",

View File

@ -2053,7 +2053,7 @@ static void _send_hello_sched(struct isis_circuit *circuit,
struct event **threadp, int level, long delay)
{
if (*threadp) {
if (thread_timer_remain_msec(*threadp) < (unsigned long)delay)
if (event_timer_remain_msec(*threadp) < (unsigned long)delay)
return;
THREAD_OFF(*threadp);

View File

@ -2250,7 +2250,7 @@ static void isis_spf_ietf_common(struct vty *vty, struct isis *isis)
vty_out(vty, " Level-%d:\n", level);
vty_out(vty, " SPF delay status: ");
if (area->spf_timer[level - 1]) {
struct timeval remain = thread_timer_remain(
struct timeval remain = event_timer_remain(
area->spf_timer[level - 1]);
vty_out(vty, "Pending, due in %lld msec\n",
(long long)remain.tv_sec * 1000

View File

@ -375,7 +375,7 @@ adj_to_ctl(struct adj *adj)
}
actl.holdtime = adj->holdtime;
actl.holdtime_remaining =
thread_timer_remain_second(adj->inactivity_timer);
event_timer_remain_second(adj->inactivity_timer);
actl.trans_addr = adj->trans_addr;
actl.ds_tlv = adj->ds_tlv;

View File

@ -533,7 +533,7 @@ ldp_sync_to_ctl(struct iface *iface)
ictl.timer_running = iface->ldp_sync.wait_for_sync_timer ? true : false;
ictl.wait_time_remaining =
thread_timer_remain_second(iface->ldp_sync.wait_for_sync_timer);
event_timer_remain_second(iface->ldp_sync.wait_for_sync_timer);
memset(&ictl.peer_ldp_id, 0, sizeof(ictl.peer_ldp_id));

View File

@ -835,7 +835,7 @@ nbr_to_ctl(struct nbr *nbr)
nctl.flags = nbr->flags;
nctl.max_pdu_len = nbr->max_pdu_len;
nctl.hold_time_remaining =
thread_timer_remain_second(nbr->keepalive_timer);
event_timer_remain_second(nbr->keepalive_timer);
gettimeofday(&now, NULL);
if (nbr->state == NBR_STA_OPER) {

View File

@ -733,7 +733,7 @@ void thread_master_free(struct thread_master *m)
}
/* Return remain time in milliseconds. */
unsigned long thread_timer_remain_msec(struct event *thread)
unsigned long event_timer_remain_msec(struct event *thread)
{
int64_t remain;
@ -748,12 +748,12 @@ unsigned long thread_timer_remain_msec(struct event *thread)
}
/* Return remain time in seconds. */
unsigned long thread_timer_remain_second(struct event *thread)
unsigned long event_timer_remain_second(struct event *thread)
{
return thread_timer_remain_msec(thread) / 1000LL;
return event_timer_remain_msec(thread) / 1000LL;
}
struct timeval thread_timer_remain(struct event *thread)
struct timeval event_timer_remain(struct event *thread)
{
struct timeval remain;
frr_with_mutex (&thread->mtx) {
@ -783,8 +783,7 @@ static int time_hhmmss(char *buf, int buf_size, long sec)
char *thread_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
time_hhmmss(buf, buf_size,
thread_timer_remain_second(t_timer));
time_hhmmss(buf, buf_size, event_timer_remain_second(t_timer));
} else {
snprintf(buf, buf_size, "--:--:--");
}

View File

@ -251,9 +251,9 @@ extern void event_cancel_event_ready(struct thread_master *m, void *arg);
extern void event_cancel_event(struct thread_master *m, void *arg);
extern struct event *event_fetch(struct thread_master *, struct event *event);
extern void event_call(struct event *event);
extern unsigned long thread_timer_remain_second(struct event *event);
extern struct timeval thread_timer_remain(struct event *event);
extern unsigned long thread_timer_remain_msec(struct event *event);
extern unsigned long event_timer_remain_second(struct event *event);
extern struct timeval event_timer_remain(struct event *event);
extern unsigned long event_timer_remain_msec(struct event *event);
extern int thread_should_yield(struct event *event);
/* set yield time for thread */
extern void thread_set_yield_time(struct event *event, unsigned long);

View File

@ -204,8 +204,7 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
vty_out(vty, "%sHolddown timer: %ld msec\n", prefix,
backoff->holddown);
if (backoff->t_holddown) {
struct timeval remain =
thread_timer_remain(backoff->t_holddown);
struct timeval remain = event_timer_remain(backoff->t_holddown);
vty_out(vty, "%s Still runs for %lld msec\n",
prefix,
(long long)remain.tv_sec * 1000
@ -218,7 +217,7 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
backoff->timetolearn);
if (backoff->t_timetolearn) {
struct timeval remain =
thread_timer_remain(backoff->t_timetolearn);
event_timer_remain(backoff->t_timetolearn);
vty_out(vty, "%s Still runs for %lld msec\n",
prefix,
(long long)remain.tv_sec * 1000

View File

@ -833,7 +833,7 @@ static void show_ospfv6_gr_helper_per_nbr(struct vty *vty, json_object *json,
vty_out(vty, " Actual Grace period : %d(in seconds)\n",
nbr->gr_helper_info.actual_grace_period);
vty_out(vty, " Remaining GraceTime:%ld(in seconds).\n",
thread_timer_remain_second(
event_timer_remain_second(
nbr->gr_helper_info.t_grace_timer));
vty_out(vty, " Graceful Restart reason: %s.\n\n",
ospf6_restart_reason_desc[nbr->gr_helper_info
@ -850,8 +850,8 @@ static void show_ospfv6_gr_helper_per_nbr(struct vty *vty, json_object *json,
json_object_int_add(json_neigh, "actualGraceInterval",
nbr->gr_helper_info.actual_grace_period);
json_object_int_add(json_neigh, "remainGracetime",
thread_timer_remain_second(
nbr->gr_helper_info.t_grace_timer));
event_timer_remain_second(
nbr->gr_helper_info.t_grace_timer));
json_object_string_add(json_neigh, "restartReason",
ospf6_restart_reason_desc[
nbr->gr_helper_info.gr_restart_reason]);

View File

@ -10136,9 +10136,9 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
.actual_grace_period);
vty_out(vty,
" Remaining GraceTime:%ld(in seconds).\n",
thread_timer_remain_second(
event_timer_remain_second(
nbr->gr_helper_info
.t_grace_timer));
.t_grace_timer));
vty_out(vty,
" Graceful Restart reason: %s.\n\n",
ospf_restart_reason2str(
@ -10169,9 +10169,9 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
.actual_grace_period);
json_object_int_add(
json_neigh, "remainGracetime",
thread_timer_remain_second(
event_timer_remain_second(
nbr->gr_helper_info
.t_grace_timer));
.t_grace_timer));
json_object_string_add(
json_neigh, "restartReason",
ospf_restart_reason2str(

View File

@ -1208,7 +1208,7 @@ static void gm_sg_timer_start(struct gm_if *gm_ifp, struct gm_sg *sg,
if (sg->t_sg_expire) {
struct timeval remain;
remain = thread_timer_remain(sg->t_sg_expire);
remain = event_timer_remain(sg->t_sg_expire);
if (timercmp(&remain, &expire_wait, <=))
return;
@ -1316,7 +1316,7 @@ static void gm_handle_q_group(struct gm_if *gm_ifp,
if (pend) {
struct timeval remain;
remain = thread_timer_remain(pend->t_expire);
remain = event_timer_remain(pend->t_expire);
if (timercmp(&remain, &timers->expire_wait, <=))
return;

View File

@ -896,7 +896,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr,
previously received join message with holdtime=0xFFFF.
*/
if (ch->t_ifjoin_expiry_timer) {
unsigned long remain = thread_timer_remain_second(
unsigned long remain = event_timer_remain_second(
ch->t_ifjoin_expiry_timer);
if (remain > holdtime) {
/*
@ -964,7 +964,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr,
pim_ifchannel_ifjoin_handler(ch, pim_ifp);
if (ch->t_ifjoin_expiry_timer) {
unsigned long remain = thread_timer_remain_second(
unsigned long remain = event_timer_remain_second(
ch->t_ifjoin_expiry_timer);
if (remain > holdtime)
@ -1087,7 +1087,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream,
* Join/Prune message.
*/
if (ch->t_ifjoin_expiry_timer) {
unsigned long rem = thread_timer_remain_second(
unsigned long rem = event_timer_remain_second(
ch->t_ifjoin_expiry_timer);
if (rem > holdtime)

View File

@ -125,7 +125,7 @@ void pim_time_timer_to_mmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
pim_time_mmss(buf, buf_size,
thread_timer_remain_second(t_timer));
event_timer_remain_second(t_timer));
} else {
snprintf(buf, buf_size, "--:--");
}
@ -135,7 +135,7 @@ void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
pim_time_hhmmss(buf, buf_size,
thread_timer_remain_second(t_timer));
event_timer_remain_second(t_timer));
} else {
snprintf(buf, buf_size, "--:--:--");
}
@ -160,5 +160,5 @@ long pim_time_timer_remain_msec(struct event *t_timer)
{
/* no timer thread running means timer has expired: return 0 */
return t_timer ? thread_timer_remain_msec(t_timer) : 0;
return t_timer ? event_timer_remain_msec(t_timer) : 0;
}

View File

@ -2926,12 +2926,12 @@ static void rip_vty_out_uptime(struct vty *vty, struct rip_info *rinfo)
struct event *thread;
if ((thread = rinfo->t_timeout) != NULL) {
clock = thread_timer_remain_second(thread);
clock = event_timer_remain_second(thread);
gmtime_r(&clock, &tm);
strftime(timebuf, TIME_BUF, "%M:%S", &tm);
vty_out(vty, "%5s", timebuf);
} else if ((thread = rinfo->t_garbage_collect) != NULL) {
clock = thread_timer_remain_second(thread);
clock = event_timer_remain_second(thread);
gmtime_r(&clock, &tm);
strftime(timebuf, TIME_BUF, "%M:%S", &tm);
vty_out(vty, "%5s", timebuf);
@ -3106,7 +3106,7 @@ DEFUN (show_ip_rip_status,
vty_out(vty, " Sending updates every %u seconds with +/-50%%,",
rip->update_time);
vty_out(vty, " next due in %lu seconds\n",
thread_timer_remain_second(rip->t_update));
event_timer_remain_second(rip->t_update));
vty_out(vty, " Timeout after %u seconds,", rip->timeout_time);
vty_out(vty, " garbage collect after %u seconds\n", rip->garbage_time);

View File

@ -877,18 +877,18 @@ static void ripng_route_process(struct rte *rte, struct sockaddr_in6 *from,
* but
* highly recommended".
*/
if (!ripng->ecmp && !same && rinfo->metric == rte->metric
&& rinfo->t_timeout
&& (thread_timer_remain_second(rinfo->t_timeout)
< (ripng->timeout_time / 2))) {
if (!ripng->ecmp && !same && rinfo->metric == rte->metric &&
rinfo->t_timeout &&
(event_timer_remain_second(rinfo->t_timeout) <
(ripng->timeout_time / 2))) {
ripng_ecmp_replace(ripng, &newinfo);
}
/* Next, compare the metrics. If the datagram is from the same
router as the existing route, and the new metric is different
than the old one; or, if the new metric is lower than the old
one; do the following actions: */
else if ((same && rinfo->metric != rte->metric)
|| rte->metric < rinfo->metric) {
else if ((same && rinfo->metric != rte->metric) ||
rte->metric < rinfo->metric) {
if (listcount(list) == 1) {
if (newinfo.metric != RIPNG_METRIC_INFINITY)
ripng_ecmp_replace(ripng, &newinfo);
@ -1934,12 +1934,12 @@ static void ripng_vty_out_uptime(struct vty *vty, struct ripng_info *rinfo)
struct event *thread;
if ((thread = rinfo->t_timeout) != NULL) {
clock = thread_timer_remain_second(thread);
clock = event_timer_remain_second(thread);
gmtime_r(&clock, &tm);
strftime(timebuf, TIME_BUF, "%M:%S", &tm);
vty_out(vty, "%5s", timebuf);
} else if ((thread = rinfo->t_garbage_collect) != NULL) {
clock = thread_timer_remain_second(thread);
clock = event_timer_remain_second(thread);
gmtime_r(&clock, &tm);
strftime(timebuf, TIME_BUF, "%M:%S", &tm);
vty_out(vty, "%5s", timebuf);
@ -2128,7 +2128,7 @@ DEFUN (show_ipv6_ripng_status,
vty_out(vty, " Sending updates every %u seconds with +/-50%%,",
ripng->update_time);
vty_out(vty, " next due in %lu seconds\n",
thread_timer_remain_second(ripng->t_update));
event_timer_remain_second(ripng->t_update));
vty_out(vty, " Timeout after %u seconds,", ripng->timeout_time);
vty_out(vty, " garbage collect after %u seconds\n",
ripng->garbage_time);

View File

@ -1148,7 +1148,7 @@ static void zebra_show_stale_client_detail(struct vty *vty,
if (info->t_stale_removal) {
vty_out(vty,
"Stale delete timer: %ld sec\n",
thread_timer_remain_second(
event_timer_remain_second(
info->t_stale_removal));
}
}