Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2017 18:11:17 +0000 (UTC)
From:      Renato Botelho <garga@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313737 - head/usr.sbin/ndp
Message-ID:  <201702141811.v1EIBHgY073108@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: garga (ports committer)
Date: Tue Feb 14 18:11:16 2017
New Revision: 313737
URL: https://svnweb.freebsd.org/changeset/base/313737

Log:
  Fix style(9)
  
  Reviewed by:	allanjude, vangyzen
  Approved by:	allanjude
  MFC after:	1 week
  Sponsored by:	Rubicon Communications (Netgate)
  Differential Revision:	https://reviews.freebsd.org/D9510

Modified:
  head/usr.sbin/ndp/ndp.c

Modified: head/usr.sbin/ndp/ndp.c
==============================================================================
--- head/usr.sbin/ndp/ndp.c	Tue Feb 14 18:03:17 2017	(r313736)
+++ head/usr.sbin/ndp/ndp.c	Tue Feb 14 18:11:16 2017	(r313737)
@@ -109,10 +109,11 @@
 #include <unistd.h>
 #include "gmt2local.h"
 
-#define NEXTADDR(w, s) \
-	if (rtm->rtm_addrs & (w)) { \
-		bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);}
-
+#define	NEXTADDR(w, s)					\
+	if (rtm->rtm_addrs & (w)) {			\
+		bcopy((char *)&s, cp, sizeof(s));	\
+		cp += SA_SIZE(&s);			\
+	}
 
 static pid_t pid;
 static int nflag;
@@ -529,10 +530,10 @@ delete:
 		printf("cannot locate %s\n", host);
 		return (1);
 	}
-        /* 
-         * need to reinit the field because it has rt_key
-         * but we want the actual address
-         */
+	/*
+	 * need to reinit the field because it has rt_key
+	 * but we want the actual address
+	 */
 	NEXTADDR(RTA_DST, sin_m);
 	rtm->rtm_flags |= RTF_LLDATA;
 	if (rtmsg(RTM_DELETE) == 0) {
@@ -604,7 +605,8 @@ again:;
 
 		rtm = (struct rt_msghdr *)next;
 		sin = (struct sockaddr_in6 *)(rtm + 1);
-		sdl = (struct sockaddr_dl *)((char *)sin + ALIGN(sin->sin6_len));
+		sdl = (struct sockaddr_dl *)((char *)sin +
+		    ALIGN(sin->sin6_len));
 
 		/*
 		 * Some OSes can produce a route that has the LINK flag but
@@ -724,7 +726,7 @@ again:;
 			    isrouter ? "R" : "",
 			    (rtm->rtm_flags & RTF_ANNOUNCE) ? "p" : "");
 		} else {
-#if 0	/* W and P are mystery even for us */
+#if 0			/* W and P are mystery even for us */
 			sin = (struct sockaddr_in6 *)
 			    (sdl->sdl_len + (char *)sdl);
 			snprintf(flgbuf, sizeof(flgbuf), "%s%s%s%s",
@@ -855,7 +857,7 @@ rtmsg(int cmd)
 			rtm->rtm_inits = RTV_EXPIRE;
 		}
 		rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA);
-#if 0 /* we don't support ipv6addr/128 type proxying */
+#if 0		/* we don't support ipv6addr/128 type proxying */
 		if (rtm->rtm_flags & RTF_ANNOUNCE) {
 			rtm->rtm_flags &= ~RTF_HOST;
 			rtm->rtm_addrs |= RTA_NETMASK;
@@ -868,7 +870,7 @@ rtmsg(int cmd)
 
 	NEXTADDR(RTA_DST, sin_m);
 	NEXTADDR(RTA_GATEWAY, sdl_m);
-#if 0 /* we don't support ipv6addr/128 type proxying */
+#if 0	/* we don't support ipv6addr/128 type proxying */
 	memset(&so_mask.sin6_addr, 0xff, sizeof(so_mask.sin6_addr));
 	NEXTADDR(RTA_NETMASK, so_mask);
 #endif
@@ -913,7 +915,7 @@ ifinfo(char *ifname, int argc, char **ar
 		err(1, "ioctl(SIOCGIFINFO_IN6)");
 		/* NOTREACHED */
 	}
-#define ND nd.ndi
+#define	ND nd.ndi
 	newflags = ND.flags;
 	for (i = 0; i < argc; i++) {
 		int clear = 0;
@@ -924,35 +926,33 @@ ifinfo(char *ifname, int argc, char **ar
 			cp++;
 		}
 
-#define SETFLAG(s, f) \
-	do {\
-		if (strcmp(cp, (s)) == 0) {\
-			if (clear)\
-				newflags &= ~(f);\
-			else\
-				newflags |= (f);\
-		}\
-	} while (0)
+#define	SETFLAG(s, f) do {			\
+	if (strcmp(cp, (s)) == 0) {		\
+		if (clear)			\
+			newflags &= ~(f);	\
+		else				\
+			newflags |= (f);	\
+	}					\
+} while (0)
 /*
  * XXX: this macro is not 100% correct, in that it matches "nud" against
  *      "nudbogus".  But we just let it go since this is minor.
  */
-#define SETVALUE(f, v) \
-	do { \
-		char *valptr; \
-		unsigned long newval; \
-		v = 0; /* unspecified */ \
-		if (strncmp(cp, f, strlen(f)) == 0) { \
-			valptr = strchr(cp, '='); \
-			if (valptr == NULL) \
-				err(1, "syntax error in %s field", (f)); \
-			errno = 0; \
-			newval = strtoul(++valptr, NULL, 0); \
-			if (errno) \
-				err(1, "syntax error in %s's value", (f)); \
-			v = newval; \
-		} \
-	} while (0)
+#define	SETVALUE(f, v) do {						\
+	char *valptr;							\
+	unsigned long newval;						\
+	v = 0; /* unspecified */					\
+	if (strncmp(cp, f, strlen(f)) == 0) {				\
+		valptr = strchr(cp, '=');				\
+		if (valptr == NULL)					\
+			err(1, "syntax error in %s field", (f));	\
+		errno = 0;						\
+		newval = strtoul(++valptr, NULL, 0);			\
+		if (errno)						\
+			err(1, "syntax error in %s's value", (f));	\
+		v = newval;						\
+	}								\
+} while (0)
 
 		SETFLAG("disabled", ND6_IFF_IFDISABLED);
 		SETFLAG("nud", ND6_IFF_PERFORMNUD);
@@ -1021,7 +1021,7 @@ ifinfo(char *ifname, int argc, char **ar
 				printf("%02x", rbuf[j]);
 		}
 	}
-#endif
+#endif /* IPV6CTL_USETEMPADDR */
 	if (ND.flags) {
 		printf("\nFlags: ");
 #ifdef ND6_IFF_IFDISABLED
@@ -1314,7 +1314,7 @@ getdefif()
 
 	close(s);
 }
-#endif
+#endif /* SIOCSDEFIFACE_IN6 */
 
 static char *
 sec2str(time_t total)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702141811.v1EIBHgY073108>