From owner-svn-src-all@freebsd.org Tue Feb 14 18:11:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B10CDE38A; Tue, 14 Feb 2017 18:11:18 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01FBF1D39; Tue, 14 Feb 2017 18:11:17 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EIBHNQ073109; Tue, 14 Feb 2017 18:11:17 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EIBHgY073108; Tue, 14 Feb 2017 18:11:17 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201702141811.v1EIBHgY073108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 14 Feb 2017 18:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313737 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 18:11:18 -0000 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 #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)