summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-07-28 17:23:36 +0200
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-07-28 13:27:47 +0200
commita05d8b7ae46410c6782729375090306fd56b4561 (patch)
tree6cb6128cae913e6f6b5044537f0752031c1aae1a /ospfd
parentbgpd: ditch unused bgp_node_*() functions (diff)
downloadfrr-a05d8b7ae46410c6782729375090306fd56b4561.tar.xz
frr-a05d8b7ae46410c6782729375090306fd56b4561.zip
ospfd: monotonic clock for lsa_refresher_started
ospf->lsa_refresher_started is only used in relative timing to itself; replace with monotonic clock which is appropriate for this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_lsa.c6
-rw-r--r--ospfd/ospfd.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index ec0eab5f0..7e34e5dd9 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -3731,7 +3731,7 @@ ospf_refresher_register_lsa (struct ospf *ospf, struct ospf_lsa *lsa)
*/
delay = (random() % (max_delay - min_delay)) + min_delay;
- current_index = ospf->lsa_refresh_queue.index + (quagga_time (NULL)
+ current_index = ospf->lsa_refresh_queue.index + (quagga_monotime ()
- ospf->lsa_refresher_started)/OSPF_LSA_REFRESHER_GRANULARITY;
index = (current_index + delay/OSPF_LSA_REFRESHER_GRANULARITY)
@@ -3795,7 +3795,7 @@ ospf_lsa_refresh_walker (struct thread *t)
modulus. */
ospf->lsa_refresh_queue.index =
((unsigned long)(ospf->lsa_refresh_queue.index +
- (quagga_time (NULL) - ospf->lsa_refresher_started)
+ (quagga_monotime () - ospf->lsa_refresher_started)
/ OSPF_LSA_REFRESHER_GRANULARITY))
% OSPF_LSA_REFRESHER_SLOTS;
@@ -3836,7 +3836,7 @@ ospf_lsa_refresh_walker (struct thread *t)
ospf->t_lsa_refresher = thread_add_timer (master, ospf_lsa_refresh_walker,
ospf, ospf->lsa_refresh_interval);
- ospf->lsa_refresher_started = quagga_time (NULL);
+ ospf->lsa_refresher_started = quagga_monotime ();
for (ALL_LIST_ELEMENTS (lsa_to_refresh, node, nnode, lsa))
{
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 2034ed1db..2a3f9c1d0 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -272,7 +272,7 @@ ospf_new (u_short instance)
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 = quagga_time (NULL);
+ new->lsa_refresher_started = quagga_monotime ();
if ((new->fd = ospf_sock_init()) < 0)
{
@@ -1598,7 +1598,7 @@ ospf_timers_refresh_set (struct ospf *ospf, int interval)
return 1;
time_left = ospf->lsa_refresh_interval -
- (quagga_time (NULL) - ospf->lsa_refresher_started);
+ (quagga_monotime () - ospf->lsa_refresher_started);
if (time_left > interval)
{
@@ -1617,7 +1617,7 @@ ospf_timers_refresh_unset (struct ospf *ospf)
int time_left;
time_left = ospf->lsa_refresh_interval -
- (quagga_time (NULL) - ospf->lsa_refresher_started);
+ (quagga_monotime () - ospf->lsa_refresher_started);
if (time_left > OSPF_LSA_REFRESH_INTERVAL_DEFAULT)
{