[quagga-dev 4634] ripd update timer display bug

Andrew J. Schorr aschorr at telemetry-investments.com
Wed Mar 21 18:08:04 GMT 2007


Hi,

When running ripd (current CVS) with no interfaces configured for route
advertisement (i.e. all enabled interfaces are configured to be passive),
the command "show ip rip status" gives output like this:

ti84# show ip rip status
Routing Protocol is "rip"
  Sending updates every 30 seconds with +/-50%, next due in -1174499333 seconds
...

It looks to me like this is a casualty of the recent relative time patches.
Does the attached patch make sense?

Regards,
Andy
-------------- next part --------------
Index: ripd/ripd.c
===================================================================
RCS file: /var/cvsroot/quagga/ripd/ripd.c,v
retrieving revision 1.59
diff -b -u -p -r1.59 ripd.c
--- ripd/ripd.c	12 Dec 2006 19:18:21 -0000	1.59
+++ ripd/ripd.c	21 Mar 2007 18:07:26 -0000
@@ -3500,17 +3500,6 @@ DEFUN (show_ip_rip,
   return CMD_SUCCESS;
 }
 
-/* Return next event time. */
-static int
-rip_next_thread_timer (struct thread *thread)
-{
-  struct timeval timer_now;
-
-  gettimeofday (&timer_now, NULL);
-
-  return thread->u.sands.tv_sec - timer_now.tv_sec;
-}
-
 /* Vincent: formerly, it was show_ip_protocols_rip: "show ip protocols" */
 DEFUN (show_ip_rip_status,
        show_ip_rip_status_cmd,
@@ -3533,8 +3522,8 @@ DEFUN (show_ip_rip_status,
   vty_out (vty, "Routing Protocol is \"rip\"%s", VTY_NEWLINE);
   vty_out (vty, "  Sending updates every %ld seconds with +/-50%%,",
 	   rip->update_time);
-  vty_out (vty, " next due in %d seconds%s", 
-	   rip_next_thread_timer (rip->t_update),
+  vty_out (vty, " next due in %lu seconds%s", 
+	   thread_timer_remain_second(rip->t_update),
 	   VTY_NEWLINE);
   vty_out (vty, "  Timeout after %ld seconds,", rip->timeout_time);
   vty_out (vty, " garbage collect after %ld seconds%s", rip->garbage_time,


More information about the Quagga-dev mailing list