static void lsp_print_flooding(struct vty *vty, struct isis_lsp *lsp)
{
char lspid[255];
+ char buf[MONOTIME_STRLEN];
lspid_print(lsp->hdr.lsp_id, lspid, true, true);
vty_out(vty, "Flooding information for %s\n", lspid);
lsp->flooding_interface : "(null)");
time_t uptime = time(NULL) - lsp->flooding_time;
- struct tm tm;
- gmtime_r(&uptime, &tm);
+ frrtime_to_interval(uptime, buf, sizeof(buf));
- if (uptime < ONE_DAY_SECOND)
- vty_out(vty, "%02d:%02d:%02d", tm.tm_hour, tm.tm_min,
- tm.tm_sec);
- else if (uptime < ONE_WEEK_SECOND)
- vty_out(vty, "%dd%02dh%02dm", tm.tm_yday, tm.tm_hour,
- tm.tm_min);
- else
- vty_out(vty, "%02dw%dd%02dh", tm.tm_yday / 7,
- tm.tm_yday - ((tm.tm_yday / 7) * 7),
- tm.tm_hour);
- vty_out(vty, " ago)\n");
+ vty_out(vty, "%s ago)\n", buf);
if (lsp->flooding_circuit_scoped) {
vty_out(vty, " Received as circuit-scoped LSP, so not "