diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-04-03 09:46:29 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-04-03 09:46:29 +0000 |
| commit | 7ba5bbee67c9c124337eed38437dc7441edc83a4 (patch) | |
| tree | 0bd0f68cca4ec61ea4e56cfadab5387672c38f02 | |
| parent | c1c5b1f445181c48fcf56cfb0916376064827a82 (diff) | |
| download | busybox-w32-7ba5bbee67c9c124337eed38437dc7441edc83a4.tar.gz busybox-w32-7ba5bbee67c9c124337eed38437dc7441edc83a4.tar.bz2 busybox-w32-7ba5bbee67c9c124337eed38437dc7441edc83a4.zip | |
- 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
git-svn-id: svn://busybox.net/trunk/busybox@14734 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | networking/arping.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/networking/arping.c b/networking/arping.c index 4f1a2e2c5..7618e9630 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
| @@ -36,8 +36,8 @@ enum cfg_e { | |||
| 36 | advert = 4, | 36 | advert = 4, |
| 37 | quiet = 8, | 37 | quiet = 8, |
| 38 | quit_on_reply = 16, | 38 | quit_on_reply = 16, |
| 39 | unicasting = 32, | 39 | broadcast_only = 32, |
| 40 | broadcast_only = 64 | 40 | unicasting = 64 |
| 41 | }; | 41 | }; |
| 42 | static int cfg; | 42 | static int cfg; |
| 43 | 43 | ||
| @@ -281,22 +281,11 @@ int arping_main(int argc, char **argv) | |||
| 281 | char *_count, *_timeout, *_device; | 281 | char *_count, *_timeout, *_device; |
| 282 | opt = bb_getopt_ulflags(argc, argv, "DUAqfbc:w:i:s:", | 282 | opt = bb_getopt_ulflags(argc, argv, "DUAqfbc:w:i:s:", |
| 283 | &_count, &_timeout, &_device); | 283 | &_count, &_timeout, &_device); |
| 284 | if (opt & 1) { /* Dad */ | 284 | cfg |= opt & 63; /* set respective flags */ |
| 285 | cfg |= dad; | 285 | if (opt & 1) /* Dad also sets quit_on_reply */ |
| 286 | cfg |= quit_on_reply; | 286 | cfg |= quit_on_reply; |
| 287 | } | 287 | if (opt & 4) /* Advert also sets unsolicited */ |
| 288 | if (opt & 2) /* Unsolicited */ | ||
| 289 | cfg |= unsolicited; | ||
| 290 | if (opt & 4) { /* Advert */ | ||
| 291 | cfg |= advert; | ||
| 292 | cfg |= unsolicited; | 288 | cfg |= unsolicited; |
| 293 | } | ||
| 294 | if (opt & 8) /* quiet */ | ||
| 295 | cfg |= quiet; | ||
| 296 | if (opt & 16) /* quit on reply */ | ||
| 297 | cfg |= quit_on_reply; | ||
| 298 | if (opt & 32) /* broadcast only */ | ||
| 299 | cfg |= broadcast_only; | ||
| 300 | if (opt & 64) /* count */ | 289 | if (opt & 64) /* count */ |
| 301 | count = atoi(_count); | 290 | count = atoi(_count); |
| 302 | if (opt & 128) /* timeout */ | 291 | if (opt & 128) /* timeout */ |
