]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix printed value of last-update timestamp
authorVladimir L Ivanov <wawa@yandex-team.ru>
Thu, 21 Oct 2010 10:59:54 +0000 (14:59 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 21 Oct 2010 10:59:54 +0000 (14:59 +0400)
* bgp_route.c: (route_vty_out_detail) calculate time value
    in a way, which works regardless of monotonic clock
    being used or not

bgpd/bgp_route.c

index 2391f740156c30ecd0f3fb902cb0e8282f6f8fa5..1cfc451188894f39c9a66707ba5ab79b700c8e46 100644 (file)
@@ -6145,7 +6145,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
        bgp_damp_info_vty (vty, binfo);
 
       /* Line 7 display Uptime */
-      vty_out (vty, "      Last update: %s", ctime (&binfo->uptime));
+      time_t tbuf = time(NULL) - (bgp_clock() - binfo->uptime);
+      vty_out (vty, "      Last update: %s", ctime(&tbuf));
     }
   vty_out (vty, "%s", VTY_NEWLINE);
 }