[quagga-dev 7915] Re: bug in "Last update:" time &binfo->uptime in bgp_route.c route_vty_out_detail ???

John Kemp kemp at network-services.uoregon.edu
Mon Apr 12 23:52:20 BST 2010


So... I have to think I got it wrong here.  If the "uptime"
for the peer stored internally in MONOTONIC time, then I have
to think I really need to use a value relative to both the
current bgp_clock and the storage base time, like:

time_t diff,last_update_time;
diff = timeval_subtract ( bgp_clock() - binfo->uptime );
last_update_time.tv_sec = relative_time_base.tv_sec + diff.tv_sec;
last_update_time.tv_usec = relative_time_base.tv_usec + diff.tv_usec;

Better?

John Kemp

On 04/12/2010 01:32 PM, John Kemp wrote:
> 
> Looking at this, I suspect that it should be a value
> calculated using bgp_clock().  So something like
> this maybe???
> 
> ...
>  time_t last_update_time;
>  last_update_time = bgp_clock();
>  last_update_time -= binfo->uptime;
>  vty_out (vty, " Last update: %s", ctime(&last_update_time));
> 
> John Kemp
> 
> 
> John Kemp wrote:
>> Any hints on how to fix this one?  Seems like it using
>> binfo->uptime when it should be
>>
>> In 2010-03-09 99.16 quagga devel, in bgpd/bgp_route.c, in
>>
>>    6147       /* Line 7 display Uptime */
>>    6148       vty_out (vty, "      Last update: %s", ctime
>> (&binfo->uptime));
>>    6149     }
>>    6150   vty_out (vty, "%s", VTY_NEWLINE);
>>
>> I'm getting output like this for all routes:
>>
>>   11537 11164 4134
>>     64.57.29.241 from 64.57.29.241 (64.57.29.241)
>>       Origin IGP, metric 0, localpref 100, valid, external
>>       Community: 11164:1120 11164:7880 11537:25200
>>       Last update: Thu Feb  4 23:49:06 1971
>>
>> My config is like this:
>>
>> ./configure  \
>>         --exec-prefix=/usr/local \
>>         --localstatedir=/var/run/quagga \
>>         --enable-logfile-mask=0644 \
>>         --with-libpam --enable-user=quagga --enable-group=quagga
>> --enable-vty-group=quaggavty \
>>         --enable-bgpd \
>>         --disable-zebra \
>>         --disable-ripd \
>>         --disable-ripngd \
>>         --disable-ospfd \
>>         --disable-ospf6d \
>>         --disable-isisd \
>>         --disable-bgp-announce \
>>         --disable-irdp \
>>         --disable-capabilities \
>>         --enable-ipv6
>>
>> John Kemp (kemp at network-services.uoregon.edu)
>>   
> 
> 




More information about the Quagga-dev mailing list