[quagga-dev 3742] Re: [quagga-users 5672] ospf timer display format

Andrew J. Schorr aschorr at telemetry-investments.com
Fri Oct 21 17:44:17 BST 2005


On Fri, Oct 21, 2005 at 05:03:58AM +0100, Paul Jakma wrote:
> Ok, see attached diff[1].
> 
> - changes SPF timers to millisecond resolution (with new defaults)
> - makes the holdtime adaptive, with a linear back-off
> - eliminates two gettimeofday's which were called from early thread
>   context
> - ospf_timeval_dump prints out the relative timeval adaptively
> - ospf_vty.c: changes for the SPF timers command, plus cleaned up the
>   'show ip ospf neighbor' header a bit.

It looks like this has already been committed.  I haven't looked closely,
but I did notice the following in ospf_timeval_dump:

  if (ms >= 1000)
    {
      t->tv_sec = ms / 1000;
      ms =- t->tv_sec * 1000;
    }

Shouldn't that say:

  if (ms >= 1000)
    {
      t->tv_sec += ms / 1000;
      ms %= 1000;
    }

(And yes, I understand it's some kind of strange corner case where
the timeval microseconds is >= 1 million.  But does it
then necessarily follow that tv_sec is zero?)

Also, the code just below seems ripe for a macro (since the same logic
is repeated for weeks, days, hours, and minutes...

> Next up after this, RFC3137 stub-router support ;).

Sounds good.

Regards,
Andy



More information about the Quagga-dev mailing list