diff options
author | vsevolod <vsevolod@FreeBSD.org> | 2015-02-02 14:37:45 +0000 |
---|---|---|
committer | vsevolod <vsevolod@FreeBSD.org> | 2015-02-02 14:37:45 +0000 |
commit | baaa04fd525b2ceb0a43fcc7c22623394f6545f6 (patch) | |
tree | fd952a657ecdf2199e6b4634c23cc3d342075db5 /sbin/ifconfig/af_inet6.c | |
parent | 6a39979cd265fe809358adb6070c064e4e020600 (diff) | |
download | FreeBSD-src-baaa04fd525b2ceb0a43fcc7c22623394f6545f6.zip FreeBSD-src-baaa04fd525b2ceb0a43fcc7c22623394f6545f6.tar.gz |
Style(9) fixes.
Approved by: bapt, ae
X-MFC-With: r278080
Diffstat (limited to 'sbin/ifconfig/af_inet6.c')
-rw-r--r-- | sbin/ifconfig/af_inet6.c | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index b1529e23..b8121a6 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -58,8 +58,8 @@ static const char rcsid[] = #include "ifconfig.h" static struct in6_ifreq in6_ridreq; -static struct in6_aliasreq in6_addreq = - { .ifra_flags = 0, +static struct in6_aliasreq in6_addreq = + { .ifra_flags = 0, .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; static int ip6lifetime; @@ -284,20 +284,23 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0) printf("prefer_source "); - in6_print_scope((uint8_t *)&((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_addr); + in6_print_scope((uint8_t *)&((struct sockaddr_in6 *) + (ifa->ifa_addr))->sin6_addr); if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { printf("pltime "); if (lifetime.ia6t_preferred) { printf("%s ", lifetime.ia6t_preferred < now.tv_sec - ? "0" : sec2str(lifetime.ia6t_preferred - now.tv_sec)); + ? "0" : + sec2str(lifetime.ia6t_preferred - now.tv_sec)); } else printf("infty "); printf("vltime "); if (lifetime.ia6t_expire) { printf("%s ", lifetime.ia6t_expire < now.tv_sec - ? "0" : sec2str(lifetime.ia6t_expire - now.tv_sec)); + ? "0" : + sec2str(lifetime.ia6t_expire - now.tv_sec)); } else printf("infty "); } @@ -372,25 +375,25 @@ in6_getaddr(const char *s, int which) static int prefix(void *val, int size) { - u_char *name = (u_char *)val; - int byte, bit, plen = 0; + u_char *name = (u_char *)val; + int byte, bit, plen = 0; - for (byte = 0; byte < size; byte++, plen += 8) - if (name[byte] != 0xff) - break; + for (byte = 0; byte < size; byte++, plen += 8) + if (name[byte] != 0xff) + break; if (byte == size) return (plen); for (bit = 7; bit != 0; bit--, plen++) - if (!(name[byte] & (1 << bit))) - break; - for (; bit != 0; bit--) - if (name[byte] & (1 << bit)) - return(0); - byte++; - for (; byte < size; byte++) - if (name[byte]) - return(0); - return (plen); + if (!(name[byte] & (1 << bit))) + break; + for (; bit != 0; bit--) + if (name[byte] & (1 << bit)) + return(0); + byte++; + for (; byte < size; byte++) + if (name[byte]) + return(0); + return (plen); } static char * @@ -534,7 +537,11 @@ in6_Lopt_cb(const char *optarg __unused) { ip6lifetime++; /* print IPv6 address lifetime */ } -static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb }; +static struct option in6_Lopt = { + .opt = "L", + .opt_usage = "[-L]", + .cb = in6_Lopt_cb +}; static __constructor void inet6_ctor(void) |