diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index f0cf93ac4b..5bfbb2cf7e 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -465,11 +465,15 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty, vty_out(vty, "%-3u", adj->level); /* level */ vty_out(vty, "%-13s", adj_state2string(adj->adj_state)); now = time(NULL); - if (adj->last_upd) - vty_out(vty, "%-9llu", - (unsigned long long)adj->last_upd - + adj->hold_time - now); - else + if (adj->last_upd) { + if (adj->last_upd + adj->hold_time + < (unsigned long long)now) + vty_out(vty, " Expiring"); + else + vty_out(vty, " %-9llu", + (unsigned long long)adj->last_upd + + adj->hold_time - now); + } else vty_out(vty, "- "); vty_out(vty, "%-10s", snpa_print(adj->snpa)); vty_out(vty, "\n"); @@ -489,11 +493,15 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty, vty_out(vty, ", Level: %u", adj->level); /* level */ vty_out(vty, ", State: %s", adj_state2string(adj->adj_state)); now = time(NULL); - if (adj->last_upd) - vty_out(vty, ", Expires in %s", - time2string(adj->last_upd + adj->hold_time - - now)); - else + if (adj->last_upd) { + if (adj->last_upd + adj->hold_time + < (unsigned long long)now) + vty_out(vty, " Expiring"); + else + vty_out(vty, ", Expires in %s", + time2string(adj->last_upd + + adj->hold_time - now)); + } else vty_out(vty, ", Expires in %s", time2string(adj->hold_time)); vty_out(vty, "\n");