Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2017 08:49:28 +0000 (UTC)
From:      Renato Botelho <garga@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r313763 - stable/11/usr.sbin/arp
Message-ID:  <201702150849.v1F8nSRv034162@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: garga (ports committer)
Date: Wed Feb 15 08:49:28 2017
New Revision: 313763
URL: https://svnweb.freebsd.org/changeset/base/313763

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

Modified:
  stable/11/usr.sbin/arp/arp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/arp/arp.c
==============================================================================
--- stable/11/usr.sbin/arp/arp.c	Wed Feb 15 08:43:26 2017	(r313762)
+++ stable/11/usr.sbin/arp/arp.c	Wed Feb 15 08:49:28 2017	(r313763)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
  * arp - display, set, and delete arp table entries
  */
 
-
 #include <sys/param.h>
 #include <sys/file.h>
 #include <sys/socket.h>
@@ -80,8 +79,8 @@ __FBSDID("$FreeBSD$");
 #include <strings.h>
 #include <unistd.h>
 
-typedef void (action_fn)(struct sockaddr_dl *sdl,
-	struct sockaddr_in *s_in, struct rt_msghdr *rtm);
+typedef void (action_fn)(struct sockaddr_dl *sdl, struct sockaddr_in *s_in,
+    struct rt_msghdr *rtm);
 
 static int search(u_long addr, action_fn *action);
 static action_fn print_entry;
@@ -344,18 +343,20 @@ set(int argc, char **argv)
 			}
 		} else if (strncmp(argv[0], "blackhole", 9) == 0) {
 			if (flags & RTF_REJECT) {
-				printf("Choose one of blackhole or reject, not both.\n");
+				printf("Choose one of blackhole or reject, "
+				    "not both.");
 			}
 			flags |= RTF_BLACKHOLE;
 		} else if (strncmp(argv[0], "reject", 6) == 0) {
 			if (flags & RTF_BLACKHOLE) {
-				printf("Choose one of blackhole or reject, not both.\n");
+				printf("Choose one of blackhole or reject, "
+				    "not both.");
 			}
 			flags |= RTF_REJECT;
 		} else if (strncmp(argv[0], "trail", 5) == 0) {
 			/* XXX deprecated and undocumented feature */
 			printf("%s: Sending trailers is no longer supported\n",
-				host);
+			    host);
 		}
 		argv++;
 	}
@@ -381,7 +382,7 @@ set(int argc, char **argv)
 
 	/*
 	 * In the case a proxy-arp entry is being added for
-	 * a remote end point, the RTF_ANNOUNCE flag in the 
+	 * a remote end point, the RTF_ANNOUNCE flag in the
 	 * RTM_GET command is an indication to the kernel
 	 * routing code that the interface associated with
 	 * the prefix route covering the local end of the
@@ -467,7 +468,7 @@ delete(char *host)
 		sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr);
 
 		/*
-		 * With the new L2/L3 restructure, the route 
+		 * With the new L2/L3 restructure, the route
 		 * returned is a prefix route. The important
 		 * piece of information from the previous
 		 * RTM_GET is the interface index. In the
@@ -486,7 +487,7 @@ delete(char *host)
 		 * is a proxy-arp entry to remove.
 		 */
 		if (flags & RTF_ANNOUNCE) {
-			fprintf(stderr, "delete: cannot locate %s\n",host);
+			fprintf(stderr, "delete: cannot locate %s\n", host);
 			return (1);
 		}
 
@@ -525,7 +526,7 @@ search(u_long addr, action_fn *action)
 	mib[5] = RTF_LLINFO;
 #else
 	mib[5] = 0;
-#endif	
+#endif
 	if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
 		err(1, "route-sysctl-estimate");
 	if (needed == 0)	/* empty table */
@@ -575,7 +576,7 @@ print_entry(struct sockaddr_dl *sdl,
 	struct if_nameindex *p;
 	int seg;
 
-	if (ifnameindex == NULL) 
+	if (ifnameindex == NULL)
 		if ((ifnameindex = if_nameindex()) == NULL)
 			err(1, "cannot retrieve interface names");
 
@@ -597,7 +598,8 @@ print_entry(struct sockaddr_dl *sdl,
 		    sdl->sdl_type == IFT_L2VLAN ||
 		    sdl->sdl_type == IFT_BRIDGE) &&
 		    sdl->sdl_alen == ETHER_ADDR_LEN)
-			printf("%s", ether_ntoa((struct ether_addr *)LLADDR(sdl)));
+			printf("%s",
+			    ether_ntoa((struct ether_addr *)LLADDR(sdl)));
 		else {
 			int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
 
@@ -607,7 +609,7 @@ print_entry(struct sockaddr_dl *sdl,
 		printf("(incomplete)");
 
 	for (p = ifnameindex; p && ifnameindex->if_index &&
-		 ifnameindex->if_name; p++) {
+	    ifnameindex->if_name; p++) {
 		if (p->if_index == sdl->sdl_index) {
 			printf(" on %s", p->if_name);
 			break;
@@ -629,31 +631,31 @@ print_entry(struct sockaddr_dl *sdl,
 		printf(" published");
 	switch(sdl->sdl_type) {
 	case IFT_ETHER:
-                printf(" [ethernet]");
-                break;
+		printf(" [ethernet]");
+		break;
 	case IFT_ISO88025:
-                printf(" [token-ring]");
+		printf(" [token-ring]");
 		trld = SDL_ISO88025(sdl);
 		if (trld->trld_rcf != 0) {
 			printf(" rt=%x", ntohs(trld->trld_rcf));
 			for (seg = 0;
 			     seg < ((TR_RCF_RIFLEN(trld->trld_rcf) - 2 ) / 2);
-			     seg++) 
+			     seg++)
 				printf(":%x", ntohs(*(trld->trld_route[seg])));
 		}
                 break;
 	case IFT_FDDI:
-                printf(" [fddi]");
-                break;
+		printf(" [fddi]");
+		break;
 	case IFT_ATM:
-                printf(" [atm]");
-                break;
+		printf(" [atm]");
+		break;
 	case IFT_L2VLAN:
 		printf(" [vlan]");
 		break;
 	case IFT_IEEE1394:
-                printf(" [firewire]");
-                break;
+		printf(" [firewire]");
+		break;
 	case IFT_BRIDGE:
 		printf(" [bridge]");
 		break;
@@ -662,8 +664,8 @@ print_entry(struct sockaddr_dl *sdl,
 		break;
 	default:
 		break;
-        }
-		
+	}
+
 	printf("\n");
 
 }
@@ -688,13 +690,13 @@ static void
 usage(void)
 {
 	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
-		"usage: arp [-n] [-i interface] hostname",
-		"       arp [-n] [-i interface] -a",
-		"       arp -d hostname [pub]",
-		"       arp -d [-i interface] -a",
-		"       arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
-		"       arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
-		"       arp -f filename");
+	    "usage: arp [-n] [-i interface] hostname",
+	    "       arp [-n] [-i interface] -a",
+	    "       arp -d hostname [pub]",
+	    "       arp -d [-i interface] -a",
+	    "       arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
+	    "       arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
+	    "       arp -f filename");
 	exit(1);
 }
 
@@ -753,12 +755,12 @@ rtmsg(int cmd, struct sockaddr_in *dst, 
 	case RTM_GET:
 		rtm->rtm_addrs |= RTA_DST;
 	}
-#define NEXTADDR(w, s)					   \
-	do {						   \
-		if ((s) != NULL && rtm->rtm_addrs & (w)) { \
-			bcopy((s), cp, sizeof(*(s)));	   \
-			cp += SA_SIZE(s);		   \
-		}					   \
+#define NEXTADDR(w, s)						\
+	do {							\
+		if ((s) != NULL && rtm->rtm_addrs & (w)) {	\
+			bcopy((s), cp, sizeof(*(s)));		\
+			cp += SA_SIZE(s);			\
+		}						\
 	} while (0)
 
 	NEXTADDR(RTA_DST, dst);
@@ -814,7 +816,7 @@ get_ether_addr(in_addr_t ipaddr, struct 
 	}
 
 #define NEXTIFR(i)						\
-    ((struct ifreq *)((char *)&(i)->ifr_addr			\
+	((struct ifreq *)((char *)&(i)->ifr_addr		\
 	+ MAX((i)->ifr_addr.sa_len, sizeof((i)->ifr_addr))) )
 
 	/*
@@ -835,14 +837,10 @@ get_ether_addr(in_addr_t ipaddr, struct 
 		if (ioctl(sock, SIOCGIFFLAGS, &ifreq) < 0)
 			continue;
 		if ((ifreq.ifr_flags &
-		     (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|
-				IFF_LOOPBACK|IFF_NOARP))
-		     != (IFF_UP|IFF_BROADCAST))
+		    (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|
+		    IFF_LOOPBACK|IFF_NOARP)) != (IFF_UP|IFF_BROADCAST))
 			continue;
-		/*
-		 * Get its netmask and check that it's on 
-		 * the right subnet.
-		 */
+		/* Get its netmask and check that it's on the right subnet. */
 		if (ioctl(sock, SIOCGIFNETMASK, &ifreq) < 0)
 			continue;
 		mask = ((struct sockaddr_in *)



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