[BusyBox-cvs] busybox/networking arping.c,1.2,1.3

Glenn McGrath bug1 at busybox.net
Sun Feb 9 07:01:38 UTC 2003


Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv23320/networking

Modified Files:
	arping.c 
Log Message:
Minor update to arping, patch from Nick Fedchik


Index: arping.c
===================================================================
RCS file: /var/cvs/busybox/networking/arping.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- arping.c	19 Jan 2003 13:31:41 -0000	1.2
+++ arping.c	9 Feb 2003 07:01:33 -0000	1.3
@@ -336,7 +336,7 @@
 		exit(socket_errno);
 	}
 
-	if (1) {
+	{
 		struct ifreq ifr;
 
 		memset(&ifr, 0, sizeof(ifr));
@@ -361,7 +361,7 @@
 		}
 	}
 
-	if (inet_aton(target, &dst) != 1) {
+	if (!inet_aton(target, &dst)) {
 		struct hostent *hp;
 
 		hp = gethostbyname2(target, AF_INET);
@@ -372,7 +372,7 @@
 		memcpy(&dst, hp->h_addr, 4);
 	}
 
-	if (source && inet_aton(source, &src) != 1) {
+	if (source && !inet_aton(source, &src)) {
 		error_msg("invalid source address %s", source);
 		exit(2);
 	}
@@ -436,7 +436,7 @@
 		exit(2);
 	}
 
-	if (1) {
+	{
 		int alen = sizeof(me);
 
 		if (getsockname(s, (struct sockaddr *) &me, &alen) == -1) {
@@ -451,9 +451,11 @@
 	he = me;
 	memset(he.sll_addr, -1, he.sll_halen);
 
-	if (!quiet)
-		printf("ARPING to %s from %s via %s\n", inet_ntoa(dst),
-			   inet_ntoa(src), device ? device : "unknown");
+	if (!quiet) {
+		printf("ARPING to %s", inet_ntoa(dst));
+		printf(" from %s via %s\n", inet_ntoa(src),
+			   device ? device : "unknown");
+	}
 
 	if (!src.s_addr && !dad) {
 		error_msg("no src address in the non-DAD mode");




More information about the busybox-cvs mailing list