diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-08-27 08:49:29 +0200 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-08-27 08:49:29 +0200 |
commit | 2518efd15b75687d4791a5eb4b0d7febc36cffbc (patch) | |
tree | 075b833f292ba3e64117a9ffb440578c70be5a2a /ospfd/ospf_spf.c | |
parent | [lib] Bug #134: threads should be more robust against backward time jumps (diff) | |
download | frr-2518efd15b75687d4791a5eb4b0d7febc36cffbc.tar.xz frr-2518efd15b75687d4791a5eb4b0d7febc36cffbc.zip |
[ospfd] Bug #134, ospfd should be more robust to backward time change
2006-08-25 Paul Jakma <paul.jakma@sun.com>
* (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.
Diffstat (limited to 'ospfd/ospf_spf.c')
-rw-r--r-- | ospfd/ospf_spf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 7228d2d41..a133d5f87 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -1136,7 +1136,7 @@ ospf_spf_calculate (struct ospf_area *area, struct route_table *new_table, /* Increment SPF Calculation Counter. */ area->spf_calculation++; - gettimeofday (&area->ospf->ts_spf, NULL); + quagga_gettime (QUAGGA_CLK_MONOTONIC, &area->ospf->ts_spf); if (IS_DEBUG_OSPF_EVENT) zlog_debug ("ospf_spf_calculate: Stop. %ld vertices", @@ -1243,7 +1243,7 @@ ospf_spf_calculate_schedule (struct ospf *ospf) } /* XXX Monotic timers: we only care about relative time here. */ - result = tv_sub (recent_time, ospf->ts_spf); + result = tv_sub (recent_relative_time (), ospf->ts_spf); elapsed = (result.tv_sec * 1000) + (result.tv_usec / 1000); ht = ospf->spf_holdtime * ospf->spf_hold_multiplier; |