summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
authorpaul <paul>2005-10-23 15:23:05 +0000
committerpaul <paul>2005-10-23 15:23:05 +0000
commitb8ad39d47a0fea7a336305cfd04f059c8e797aad (patch)
tree8387ae1ff1f397c79c035b3b303e8ea74b53a451 /ospfd/ospf_vty.c
parentea4ffc9009ac4596fe865fd5f7e8363cdacbbd66 (diff)
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.
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 2115b987..e56027be 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -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)),