diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2017-08-18 18:43:34 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2017-08-18 18:43:34 +0000 |
commit | 8da62c95a9dc6861d981c6398f9098ab87fb116d (patch) | |
tree | 29cb3531bd2db7c4fa15817b574109a1997d988d | |
parent | cb125f847fec1fac6f1b53db23a6aab725c763fa (diff) |
Show timeouts for addresses and default routers.
-rw-r--r-- | usr.sbin/slaacctl/slaacctl.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/usr.sbin/slaacctl/slaacctl.c b/usr.sbin/slaacctl/slaacctl.c index dbd61c693ff..39dc6d8c94b 100644 --- a/usr.sbin/slaacctl/slaacctl.c +++ b/usr.sbin/slaacctl/slaacctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slaacctl.c,v 1.10 2017/08/18 18:42:58 florian Exp $ */ +/* $OpenBSD: slaacctl.c,v 1.11 2017/08/18 18:43:33 florian Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -268,19 +268,25 @@ show_interface_msg(struct imsg *imsg) printf("\t\tid: %4lld, state: %15s, privacy: %s\n", cei_addr_proposal->id, cei_addr_proposal->state, cei_addr_proposal->privacy ? "y" : "n"); + + if (clock_gettime(CLOCK_MONOTONIC, &now)) + err(1, "clock_gettime"); + + timespecsub(&now, &cei_addr_proposal->uptime, &diff); + if (cei_addr_proposal->vltime == ND6_INFINITE_LIFETIME) printf("\t\tvltime: %10s, ", "infinity"); else printf("\t\tvltime: %10u, ", cei_addr_proposal->vltime); if (cei_addr_proposal->pltime == ND6_INFINITE_LIFETIME) - printf("pltime: %10s\n", "infinity"); + printf("pltime: %10s", "infinity"); else - printf("pltime: %10u\n", cei_addr_proposal->pltime); - - if (clock_gettime(CLOCK_MONOTONIC, &now)) - err(1, "clock_gettime"); - - timespecsub(&now, &cei_addr_proposal->uptime, &diff); + printf("pltime: %10u", cei_addr_proposal->pltime); + if (cei_addr_proposal->next_timeout != 0) + printf(", timeout: %10llds\n", + cei_addr_proposal->next_timeout - diff.tv_sec); + else + printf("\n"); t = localtime(&cei_addr_proposal->when.tv_sec); strftime(whenbuf, sizeof(whenbuf), "%F %T", t); @@ -313,7 +319,12 @@ show_interface_msg(struct imsg *imsg) t = localtime(&cei_dfr_proposal->when.tv_sec); strftime(whenbuf, sizeof(whenbuf), "%F %T", t); - printf("\t\tupdated: %s; %llds ago\n", whenbuf, diff.tv_sec); + printf("\t\tupdated: %s; %llds ago", whenbuf, diff.tv_sec); + if (cei_dfr_proposal->next_timeout != 0) + printf(", timeout: %10llds\n", + cei_dfr_proposal->next_timeout - diff.tv_sec); + else + printf("\n"); break; case IMSG_CTL_END: |