]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-10-23 Paul Jakma <paul.jakma@sun.com>
authorpaul <paul>
Sun, 23 Oct 2005 15:23:05 +0000 (15:23 +0000)
committerpaul <paul>
Sun, 23 Oct 2005 15:23:05 +0000 (15:23 +0000)
* ospf_vty.c: (show_ip_ospf) fix display of SPF timer if it
  has not yet been run.

ospfd/ChangeLog
ospfd/ospf_vty.c

index 1a8817aab811fa271f0aa46938786bbece13b03b..a44612581f0573807bac0a31565885665ca218cf 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-23 Paul Jakma <paul.jakma@sun.com>
+
+       * ospf_vty.c: (show_ip_ospf) fix display of SPF timer if it
+         has not yet been run.
+
 2005-10-21 Paul Jakma <paul.jakma@sun.com>
 
        * ospf_dump.c: (ospf_timeval_dump) fix ms adjustment, thanks to
index 2115b987f25426085a06cde9d86cba67fc6484ea..e56027be5a07841a0b2e7a4d0959c1c58e7ab40c 100644 (file)
@@ -2617,10 +2617,16 @@ DEFUN (show_ip_ospf,
          ospf->spf_holdtime, VTY_NEWLINE,
          ospf->spf_max_holdtime, VTY_NEWLINE,
          ospf->spf_hold_multiplier, VTY_NEWLINE);
-  timersub (&recent_time, &ospf->ts_spf, &result);
-  vty_out (vty, " SPF algorithm last executed %s ago%s",
-           ospf_timeval_dump (&result, timebuf, sizeof (timebuf)),
-           VTY_NEWLINE);
+  vty_out (vty, " SPF algorithm ");
+  if (ospf->ts_spf.tv_sec || ospf->ts_spf.tv_usec)
+    {
+      timersub (&recent_time, &ospf->ts_spf, &result);
+      vty_out (vty, "last executed %s ago%s",
+               ospf_timeval_dump (&result, timebuf, sizeof (timebuf)),
+               VTY_NEWLINE);
+    }
+  else
+    vty_out (vty, "has not been run%s", VTY_NEWLINE);
   vty_out (vty, " SPF timer %s%s%s",
            (ospf->t_spf_calc ? "due in " : "is "),
            ospf_timer_dump (ospf->t_spf_calc, timebuf, sizeof (timebuf)),