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/ospf_vty.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ospfd/ospf_vty.c') diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 912f1d09..04e1df46 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -2691,7 +2691,7 @@ DEFUN (show_ip_ospf, vty_out (vty, " SPF algorithm "); if (ospf->ts_spf.tv_sec || ospf->ts_spf.tv_usec) { - result = tv_sub (recent_time, ospf->ts_spf); + result = tv_sub (recent_relative_time (), ospf->ts_spf); vty_out (vty, "last executed %s ago%s", ospf_timeval_dump (&result, timebuf, sizeof (timebuf)), VTY_NEWLINE); @@ -3157,7 +3157,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, vty_out (vty, " %d state changes%s", nbr->state_change, VTY_NEWLINE); if (nbr->ts_last_progress.tv_sec || nbr->ts_last_progress.tv_usec) { - struct timeval res = tv_sub (recent_time, nbr->ts_last_progress); + struct timeval res + = tv_sub (recent_relative_time (), nbr->ts_last_progress); vty_out (vty, " Most recent state change statistics:%s", VTY_NEWLINE); vty_out (vty, " Progressive change %s ago%s", @@ -3166,7 +3167,8 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, } if (nbr->ts_last_regress.tv_sec || nbr->ts_last_regress.tv_usec) { - struct timeval res = tv_sub (recent_time, nbr->ts_last_regress); + struct timeval res + = tv_sub (recent_relative_time (), nbr->ts_last_regress); vty_out (vty, " Regressive change %s ago, due to %s%s", ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), (nbr->last_regress_str ? nbr->last_regress_str : "??"), -- cgit v1.2.1