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.
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 1a8817a..a446125 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -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
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 2115b98..e56027b 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -2617,10 +2617,16 @@
 	  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)),