diff options
author | florian <florian@openbsd.org> | 2017-08-18 16:32:06 +0000 |
---|---|---|
committer | florian <florian@openbsd.org> | 2017-08-18 16:32:06 +0000 |
commit | c4834f685aee4624395bb2a2d6e6dfc34df4b361 (patch) | |
tree | 57f0bcbc249817d5c31a7af3dcf62421c61da2d3 /usr.sbin/slaacctl | |
parent | Truncating a file and then deciding not to change its (diff) | |
download | wireguard-openbsd-c4834f685aee4624395bb2a2d6e6dfc34df4b361.tar.xz wireguard-openbsd-c4834f685aee4624395bb2a2d6e6dfc34df4b361.zip |
Use "infinity" for pltime / vltime.
It's a bit easier on the eyes than 4294967295.
While here standardize on a width of 10.
Diffstat (limited to 'usr.sbin/slaacctl')
-rw-r--r-- | usr.sbin/slaacctl/slaacctl.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/usr.sbin/slaacctl/slaacctl.c b/usr.sbin/slaacctl/slaacctl.c index 6668ab10d2b..93411908424 100644 --- a/usr.sbin/slaacctl/slaacctl.c +++ b/usr.sbin/slaacctl/slaacctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slaacctl.c,v 1.7 2017/05/30 18:18:08 deraadt Exp $ */ +/* $OpenBSD: slaacctl.c,v 1.8 2017/08/18 16:32:06 florian Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -30,6 +30,7 @@ #include <netinet/in.h> #include <netinet/if_ether.h> +#include <netinet6/nd6.h> #include <err.h> #include <errno.h> @@ -234,8 +235,14 @@ show_interface_msg(struct imsg *imsg) printf("\t\t\tOn-link: %d, Autonomous address-configuration: %d" "\n", cei_ra_prefix->onlink ? 1 : 0, cei_ra_prefix->autonomous ? 1 : 0); - printf("\t\t\tvltime: %9u, pltime: %9u\n", - cei_ra_prefix->vltime, cei_ra_prefix->pltime); + if (cei_ra_prefix->vltime == ND6_INFINITE_LIFETIME) + printf("\t\t\tvltime: %10s, ", "infinity"); + else + printf("\t\t\tvltime: %10u, ", cei_ra_prefix->vltime); + if (cei_ra_prefix->pltime == ND6_INFINITE_LIFETIME) + printf("pltime: %10s\n", "infinity"); + else + printf("pltime: %10u\n", cei_ra_prefix->pltime); break; case IMSG_CTL_SHOW_INTERFACE_INFO_RA_RDNS: cei_ra_rdns = imsg->data; @@ -262,8 +269,14 @@ 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"); - printf("\t\tvltime: %10u, pltime: %10u\n", - cei_addr_proposal->vltime, cei_addr_proposal->pltime); + 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"); + else + printf("pltime: %10u\n", cei_addr_proposal->pltime); if (clock_gettime(CLOCK_MONOTONIC, &now)) err(1, "clock_gettime"); |