diff options
-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)) { |