summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/af_inet6.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-06-23 23:49:52 +0000
committerdelphij <delphij@FreeBSD.org>2009-06-23 23:49:52 +0000
commite55dc5c4eb8e9b93da21c537889150f3b177e253 (patch)
tree49d38a468ae2e816db3ae5582c13e8b2d759fc28 /sbin/ifconfig/af_inet6.c
parent6890bf4027e4cc291de70a201516b9ba03dc3cf7 (diff)
downloadFreeBSD-src-e55dc5c4eb8e9b93da21c537889150f3b177e253.zip
FreeBSD-src-e55dc5c4eb8e9b93da21c537889150f3b177e253.tar.gz
- Use size_t instead of int when appropriate;
- Use C99 sparse initialization. With these changes ifconfig(8) is WARNS=2 clean.
Diffstat (limited to 'sbin/ifconfig/af_inet6.c')
-rw-r--r--sbin/ifconfig/af_inet6.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index f1871fb..13789dc 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -58,12 +58,8 @@ static const char rcsid[] =
static struct in6_ifreq in6_ridreq;
static struct in6_aliasreq in6_addreq =
- { { 0 },
- { 0 },
- { 0 },
- { 0 },
- 0,
- { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } };
+ { .ifra_flags = 0,
+ .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } };
static int ip6lifetime;
static void in6_fillscopeid(struct sockaddr_in6 *sin6);
@@ -522,13 +518,13 @@ in6_Lopt_cb(const char *optarg __unused)
{
ip6lifetime++; /* print IPv6 address lifetime */
}
-static struct option in6_Lopt = { "L", "[-L]", in6_Lopt_cb };
+static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb };
static __constructor void
inet6_ctor(void)
{
#define N(a) (sizeof(a) / sizeof(a[0]))
- int i;
+ size_t i;
for (i = 0; i < N(inet6_cmds); i++)
cmd_register(&inet6_cmds[i]);
OpenPOWER on IntegriCloud