summaryrefslogtreecommitdiff
path: root/usr.sbin/ndp/ndp.c
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-08-05 11:53:24 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-08-05 11:53:24 +0000
commit9449a697562a7de3dbaaba3a1569e2f8eb92fbeb (patch)
tree83aaba4c6842f1fb21e257f63b2b446d970a07cf /usr.sbin/ndp/ndp.c
parentd52c9fdf7295d28450fbb1b9ecaedf691d7e3cae (diff)
Using a macro to save 4 chars is mere obfuscation.
Diffstat (limited to 'usr.sbin/ndp/ndp.c')
-rw-r--r--usr.sbin/ndp/ndp.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index 2ed262a79c7..cc16682fc80 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.76 2016/08/05 11:44:10 jca Exp $ */
+/* $OpenBSD: ndp.c,v 1.77 2016/08/05 11:53:23 jca Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -932,8 +932,7 @@ ifinfo(char *ifname, int argc, char **argv)
err(1, "ioctl(SIOCGIFINFO_IN6)");
/* NOTREACHED */
}
-#define ND nd.ndi
- newflags = ND.flags;
+ newflags = nd.ndi.flags;
for (i = 0; i < argc; i++) {
int clear = 0;
char *cp = argv[i];
@@ -955,7 +954,7 @@ ifinfo(char *ifname, int argc, char **argv)
SETFLAG("nud", ND6_IFF_PERFORMNUD);
SETFLAG("accept_rtadv", ND6_IFF_ACCEPT_RTADV);
- ND.flags = newflags;
+ nd.ndi.flags = newflags;
if (ioctl(s, SIOCSIFINFO_FLAGS, (caddr_t)&nd) < 0) {
err(1, "ioctl(SIOCSIFINFO_FLAGS)");
/* NOTREACHED */
@@ -963,24 +962,24 @@ ifinfo(char *ifname, int argc, char **argv)
#undef SETFLAG
}
- if (!ND.initialized) {
+ if (!nd.ndi.initialized) {
errx(1, "%s: not initialized yet", ifname);
/* NOTREACHED */
}
printf("basereachable=%ds%dms",
- ND.basereachable / 1000, ND.basereachable % 1000);
- printf(", reachable=%ds", ND.reachable);
- printf(", retrans=%ds%dms", ND.retrans / 1000, ND.retrans % 1000);
- if (ND.flags) {
+ nd.ndi.basereachable / 1000, nd.ndi.basereachable % 1000);
+ printf(", reachable=%ds", nd.ndi.reachable);
+ printf(", retrans=%ds%dms", nd.ndi.retrans / 1000,
+ nd.ndi.retrans % 1000);
+ if (nd.ndi.flags) {
printf("\nFlags: ");
- if ((ND.flags & ND6_IFF_PERFORMNUD))
+ if ((nd.ndi.flags & ND6_IFF_PERFORMNUD))
printf("nud ");
- if ((ND.flags & ND6_IFF_ACCEPT_RTADV))
+ if ((nd.ndi.flags & ND6_IFF_ACCEPT_RTADV))
printf("accept_rtadv ");
}
putc('\n', stdout);
-#undef ND
close(s);
}