svn commit: trunk/busybox/networking

aldot at busybox.net aldot at busybox.net
Mon Apr 3 09:46:30 UTC 2006


Author: aldot
Date: 2006-04-03 02:46:29 -0700 (Mon, 03 Apr 2006)
New Revision: 14734

Log:
- set flags in a more reasonable manner. Thanks, vodz.
   text    data     bss     dec     hex filename
   3520       4      96    3620     e24 networking/arping.o.oorig
   3488       4      96    3588     e04 networking/arping.o


Modified:
   trunk/busybox/networking/arping.c


Changeset:
Modified: trunk/busybox/networking/arping.c
===================================================================
--- trunk/busybox/networking/arping.c	2006-04-02 21:50:01 UTC (rev 14733)
+++ trunk/busybox/networking/arping.c	2006-04-03 09:46:29 UTC (rev 14734)
@@ -36,8 +36,8 @@
 	advert = 4,
 	quiet = 8,
 	quit_on_reply = 16,
-	unicasting = 32,
-	broadcast_only = 64
+	broadcast_only = 32,
+	unicasting = 64
 };
 static int cfg;
 
@@ -281,22 +281,11 @@
 		char *_count, *_timeout, *_device;
 		opt = bb_getopt_ulflags(argc, argv, "DUAqfbc:w:i:s:",
 						&_count, &_timeout, &_device);
-		if (opt & 1) { /* Dad */
-			cfg |= dad;
+		cfg |= opt & 63; /* set respective flags */
+		if (opt & 1) /* Dad also sets quit_on_reply */
 			cfg |= quit_on_reply;
-		}
-		if (opt & 2) /* Unsolicited */
+		if (opt & 4) /* Advert also sets unsolicited */
 			cfg |= unsolicited;
-		if (opt & 4) { /* Advert */
-			cfg |= advert;
-			cfg |= unsolicited;
-		}
-		if (opt & 8) /* quiet */
-			cfg |= quiet;
-		if (opt & 16) /* quit on reply */
-			cfg |= quit_on_reply;
-		if (opt & 32) /* broadcast only */
-			cfg |= broadcast_only;
 		if (opt & 64) /* count */
 			count = atoi(_count);
 		if (opt & 128) /* timeout */




More information about the busybox-cvs mailing list