diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-08-15 13:43:34 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-08-15 13:43:34 +0000 |
commit | 827b8f99a2661628afc4b3b2e3e843f7d28642d5 (patch) | |
tree | ca739f2d9b72a98567d530f8ca98d75329b98ec6 /usr.sbin/ndp | |
parent | d3510b5e988a7c3749d07e56ba89edca1bd47bf0 (diff) |
Reduce the warnings when arp, rarp, ndp are compiled with WARNINGS=yes.
warning: declaration of 'time' shadows a global declaration
No binary change; OK lteo@ florian@ henning@ mikeb@ millert@
Diffstat (limited to 'usr.sbin/ndp')
-rw-r--r-- | usr.sbin/ndp/ndp.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index cdfcb8b2d6e..177bdfb058f 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndp.c,v 1.49 2013/08/09 17:52:12 bluhm Exp $ */ +/* $OpenBSD: ndp.c,v 1.50 2013/08/15 13:43:33 bluhm Exp $ */ /* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */ /* @@ -382,10 +382,10 @@ set(int argc, char **argv) flags = 0; while (argc-- > 0) { if (strncmp(argv[0], "temp", 4) == 0) { - struct timeval time; + struct timeval now; - gettimeofday(&time, 0); - expire_time = time.tv_sec + 20 * 60; + gettimeofday(&now, 0); + expire_time = now.tv_sec + 20 * 60; } else if (strncmp(argv[0], "proxy", 5) == 0) flags |= RTF_ANNOUNCE; argv++; @@ -549,7 +549,7 @@ dump(struct in6_addr *addr, int cflag) struct sockaddr_in6 *sin; struct sockaddr_dl *sdl; struct in6_nbrinfo *nbi; - struct timeval time; + struct timeval now; int addrwidth; int llwidth; int ifwidth; @@ -636,9 +636,9 @@ again:; delete(host_buf); continue; } - gettimeofday(&time, 0); + gettimeofday(&now, 0); if (tflag) - ts_print(&time); + ts_print(&now); addrwidth = strlen(host_buf); if (addrwidth < W_ADDR) @@ -659,9 +659,9 @@ again:; /* Print neighbor discovery specific informations */ nbi = getnbrinfo(&sin->sin6_addr, sdl->sdl_index, 1); if (nbi) { - if (nbi->expire > time.tv_sec) { + if (nbi->expire > now.tv_sec) { printf(" %-9.9s", - sec2str(nbi->expire - time.tv_sec)); + sec2str(nbi->expire - now.tv_sec)); } else if (nbi->expire == 0) printf(" %-9.9s", "permanent"); else @@ -956,7 +956,7 @@ rtrlist(void) char *buf; struct in6_defrouter *p, *ep; size_t l; - struct timeval time; + struct timeval now; if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0) { err(1, "sysctl(ICMPV6CTL_ND6_DRLIST)"); @@ -991,12 +991,12 @@ rtrlist(void) rtpref = ((p->flags & ND_RA_FLAG_RTPREF_MASK) >> 3) & 0xff; printf(", pref=%s", rtpref_str[rtpref]); - gettimeofday(&time, 0); + gettimeofday(&now, 0); if (p->expire == 0) printf(", expire=Never\n"); else printf(", expire=%s\n", - sec2str(p->expire - time.tv_sec)); + sec2str(p->expire - now.tv_sec)); } free(buf); } @@ -1009,7 +1009,7 @@ plist(void) struct in6_prefix *p, *ep, *n; struct sockaddr_in6 *advrtr; size_t l; - struct timeval time; + struct timeval now; const int niflags = NI_NUMERICHOST; int ninflags = nflag ? NI_NUMERICHOST : 0; char namebuf[NI_MAXHOST]; @@ -1040,7 +1040,7 @@ plist(void) printf("%s/%d if=%s\n", namebuf, p->prefixlen, if_indextoname(p->if_index, ifix_buf)); - gettimeofday(&time, 0); + gettimeofday(&now, 0); /* * meaning of fields, especially flags, is very different * by origin. notify the difference to the users. @@ -1062,9 +1062,9 @@ plist(void) printf(", pltime=%lu", (unsigned long)p->pltime); if (p->expire == 0) printf(", expire=Never"); - else if (p->expire >= time.tv_sec) + else if (p->expire >= now.tv_sec) printf(", expire=%s", - sec2str(p->expire - time.tv_sec)); + sec2str(p->expire - now.tv_sec)); else printf(", expired"); printf(", ref=%d", p->refcnt); |