[quagga-dev 8358] proposed change for uptime output in bgp_dump_routes_func, bgp_dump.c

John Kemp kemp at network-services.uoregon.edu
Wed Nov 17 18:52:16 GMT 2010


Older versions of Quagga/Zebra would output a value in MRT table
dump files for "uptime" aka "ORIGINATED" that was a WALL clock
value.  Given that uptime is now internally a bgp_clock MONOTONIC
value, the output in the MRT files is showing up as monotonic.

Note: time of MRT dump is still recorded correctly as a
time() based value, so we haven't lost that value.

Proposal is to correct the uptime output on the vty and in the
MRT files to again display something more akin to WALL time.

We already do this for the vty using this code:

"bgpd/bgp_route.c" route_vty_out_detail
bgp_route.c: time_t temp_time;
...
bgp_route.c:      temp_time = bgp_clock();
bgp_route.c:      temp_time -= binfo->uptime;
bgp_route.c:      temp_time = time(NULL) - temp_time;
bgp_route.c:      vty_out (vty, "      Last update: %s", ctime
(&temp_time));

We propose to do the same thing for
"bgpd/bgp_dump.c" bgp_dump_routes_func
bgp_dump.c: time_t temp_time;
...
bgp_dump.c:       temp_time = bgp_clock();
bgp_dump.c:       temp_time -= info->uptime;
bgp_dump.c:       temp_time = time(NULL) - temp_time;
bgp_dump.c:       /* Originated */
bgp_dump.c:       stream_putl (obuf, temp_time);

Comments welcome.

John Kemp (kemp at routeviews.org)




More information about the Quagga-dev mailing list