From 2518efd15b75687d4791a5eb4b0d7febc36cffbc Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Sun, 27 Aug 2006 06:49:29 +0000 Subject: [ospfd] Bug #134, ospfd should be more robust to backward time change 2006-08-25 Paul Jakma * (general) Bug #134. Be more robust to backward time changes, use the newly added libzebra time functions. In most cases: recent_time -> recent_relative_time() gettimeofday -> quagga_gettime (QUAGGA_CLK_MONOTONIC, ..) time -> quagga_time. (ospf_make_md5_digest) time() call deliberately not changed. (ospf_external_lsa_refresh) remove useless gettimeofday, LSA tv_orig time was already set in ospf_lsa_new, called via ospf_external_lsa_new. --- ospfd/ospfd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ospfd/ospfd.c') diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 95615e4a..a1f0f011 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -202,7 +202,7 @@ ospf_new (void) new->lsa_refresh_interval = OSPF_LSA_REFRESH_INTERVAL_DEFAULT; new->t_lsa_refresher = thread_add_timer (master, ospf_lsa_refresh_walker, new, new->lsa_refresh_interval); - new->lsa_refresher_started = time (NULL); + new->lsa_refresher_started = quagga_time (NULL); if ((new->fd = ospf_sock_init()) < 0) { @@ -1317,7 +1317,7 @@ ospf_timers_refresh_set (struct ospf *ospf, int interval) return 1; time_left = ospf->lsa_refresh_interval - - (time (NULL) - ospf->lsa_refresher_started); + (quagga_time (NULL) - ospf->lsa_refresher_started); if (time_left > interval) { @@ -1336,7 +1336,7 @@ ospf_timers_refresh_unset (struct ospf *ospf) int time_left; time_left = ospf->lsa_refresh_interval - - (time (NULL) - ospf->lsa_refresher_started); + (quagga_time (NULL) - ospf->lsa_refresher_started); if (time_left > OSPF_LSA_REFRESH_INTERVAL_DEFAULT) { @@ -1657,5 +1657,5 @@ ospf_master_init () om = &ospf_master; om->ospf = list_new (); om->master = thread_master_create (); - om->start_time = time (NULL); + om->start_time = quagga_time (NULL); } -- cgit v1.2.1