diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-04-03 12:29:12 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-04-03 12:29:12 +0000 |
| commit | 68b36402b36b60eaddeb0ed8cceb41e0dadfd35e (patch) | |
| tree | 07dad6767842f2d2d197892c8704b4273a2fb954 | |
| parent | 77682bf5189451f2cea5fdc5aa54cc4e4e0f24f0 (diff) | |
| download | busybox-w32-68b36402b36b60eaddeb0ed8cceb41e0dadfd35e.tar.gz busybox-w32-68b36402b36b60eaddeb0ed8cceb41e0dadfd35e.tar.bz2 busybox-w32-68b36402b36b60eaddeb0ed8cceb41e0dadfd35e.zip | |
- coalesce printf calls.
text data bss dec hex filename
3474 4 96 3574 df6 networking/arping.o.orig
3424 4 96 3524 dc4 networking/arping.o
git-svn-id: svn://busybox.net/trunk/busybox@14737 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | networking/arping.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/networking/arping.c b/networking/arping.c index 6bcbc7044..48c14f15c 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
| @@ -112,8 +112,10 @@ static int send_pack(int sock, struct in_addr *src_addr, | |||
| 112 | static void finish(void) | 112 | static void finish(void) |
| 113 | { | 113 | { |
| 114 | if (!(cfg&quiet)) { | 114 | if (!(cfg&quiet)) { |
| 115 | printf("Sent %d probes (%d broadcast(s))\n", sent, brd_sent); | 115 | printf("Sent %d probes (%d broadcast(s))\n" |
| 116 | printf("Received %d repl%s", received, (received > 1) ? "ies" : "y"); | 116 | "Received %d repl%s", |
| 117 | sent, brd_sent, | ||
| 118 | received, (received > 1) ? "ies" : "y"); | ||
| 117 | if (brd_recv || req_recv) { | 119 | if (brd_recv || req_recv) { |
| 118 | printf(" ("); | 120 | printf(" ("); |
| 119 | if (req_recv) | 121 | if (req_recv) |
| @@ -221,12 +223,11 @@ static int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM) | |||
| 221 | 223 | ||
| 222 | gettimeofday(&tv, NULL); | 224 | gettimeofday(&tv, NULL); |
| 223 | 225 | ||
| 224 | printf("%s ", | 226 | printf("%s %s from %s [%s]", |
| 225 | FROM->sll_pkttype == PACKET_HOST ? "Unicast" : "Broadcast"); | 227 | FROM->sll_pkttype == PACKET_HOST ? "Unicast" : "Broadcast", |
| 226 | printf("%s from ", | 228 | ah->ar_op == htons(ARPOP_REPLY) ? "reply" : "request", |
| 227 | ah->ar_op == htons(ARPOP_REPLY) ? "reply" : "request"); | 229 | inet_ntoa(src_ip), |
| 228 | printf("%s ", inet_ntoa(src_ip)); | 230 | ether_ntoa((struct ether_addr *) p)); |
| 229 | printf("[%s]", ether_ntoa((struct ether_addr *) p)); | ||
| 230 | if (dst_ip.s_addr != src.s_addr) { | 231 | if (dst_ip.s_addr != src.s_addr) { |
| 231 | printf("for %s ", inet_ntoa(dst_ip)); | 232 | printf("for %s ", inet_ntoa(dst_ip)); |
| 232 | s_printed = 1; | 233 | s_printed = 1; |
| @@ -421,9 +422,9 @@ int arping_main(int argc, char **argv) | |||
| 421 | memset(he.sll_addr, -1, he.sll_halen); | 422 | memset(he.sll_addr, -1, he.sll_halen); |
| 422 | 423 | ||
| 423 | if (!(cfg&quiet)) { | 424 | if (!(cfg&quiet)) { |
| 424 | printf("ARPING to %s", inet_ntoa(dst)); | 425 | printf("ARPING to %s from %s via %s\n", |
| 425 | printf(" from %s via %s\n", inet_ntoa(src), | 426 | inet_ntoa(dst), inet_ntoa(src), |
| 426 | device ? device : "unknown"); | 427 | device ? device : "unknown"); |
| 427 | } | 428 | } |
| 428 | 429 | ||
| 429 | if (!src.s_addr && !(cfg&dad)) { | 430 | if (!src.s_addr && !(cfg&dad)) { |
