diff options
-rw-r--r-- | networking/arping.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/networking/arping.c b/networking/arping.c index fd2f52cdb..898c3054e 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -142,10 +142,10 @@ static void finish(void) | |||
142 | { | 142 | { |
143 | if (!(option_mask32 & QUIET)) { | 143 | if (!(option_mask32 & QUIET)) { |
144 | printf("Sent %u probe(s) (%u broadcast(s))\n" | 144 | printf("Sent %u probe(s) (%u broadcast(s))\n" |
145 | "Received %u repl%s" | 145 | "Received %u response(s)" |
146 | " (%u request(s), %u broadcast(s))\n", | 146 | " (%u request(s), %u broadcast(s))\n", |
147 | sent, brd_sent, | 147 | sent, brd_sent, |
148 | received, (received == 1) ? "ies" : "y", | 148 | received, |
149 | req_recv, brd_recv); | 149 | req_recv, brd_recv); |
150 | } | 150 | } |
151 | if (option_mask32 & DAD) | 151 | if (option_mask32 & DAD) |
@@ -245,6 +245,7 @@ static void recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM) | |||
245 | if (!(option_mask32 & QUIET)) { | 245 | if (!(option_mask32 & QUIET)) { |
246 | int s_printed = 0; | 246 | int s_printed = 0; |
247 | 247 | ||
248 | //TODO: arping from iputils-s20160308 print upprcase hex in MAC, follow them? | ||
248 | printf("%scast re%s from %s [%02x:%02x:%02x:%02x:%02x:%02x]", | 249 | printf("%scast re%s from %s [%02x:%02x:%02x:%02x:%02x:%02x]", |
249 | FROM->sll_pkttype == PACKET_HOST ? "Uni" : "Broad", | 250 | FROM->sll_pkttype == PACKET_HOST ? "Uni" : "Broad", |
250 | ah->ar_op == htons(ARPOP_REPLY) ? "ply" : "quest", | 251 | ah->ar_op == htons(ARPOP_REPLY) ? "ply" : "quest", |
@@ -252,14 +253,14 @@ static void recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM) | |||
252 | p[0], p[1], p[2], p[3], p[4], p[5] | 253 | p[0], p[1], p[2], p[3], p[4], p[5] |
253 | ); | 254 | ); |
254 | if (dst_ip.s_addr != src.s_addr) { | 255 | if (dst_ip.s_addr != src.s_addr) { |
255 | printf("for %s ", inet_ntoa(dst_ip)); | 256 | printf("for %s", inet_ntoa(dst_ip)); |
256 | s_printed = 1; | 257 | s_printed = 1; |
257 | } | 258 | } |
258 | if (memcmp(p + ah->ar_hln + 4, me.sll_addr, ah->ar_hln)) { | 259 | if (memcmp(p + ah->ar_hln + 4, me.sll_addr, ah->ar_hln)) { |
259 | unsigned char *pp = p + ah->ar_hln + 4; | 260 | unsigned char *pp = p + ah->ar_hln + 4; |
260 | if (!s_printed) | 261 | if (!s_printed) |
261 | printf("for "); | 262 | printf(" for"); |
262 | printf("[%02x:%02x:%02x:%02x:%02x:%02x]", | 263 | printf(" [%02x:%02x:%02x:%02x:%02x:%02x]", |
263 | pp[0], pp[1], pp[2], pp[3], pp[4], pp[5] | 264 | pp[0], pp[1], pp[2], pp[3], pp[4], pp[5] |
264 | ); | 265 | ); |
265 | } | 266 | } |
@@ -408,8 +409,8 @@ int arping_main(int argc UNUSED_PARAM, char **argv) | |||
408 | 409 | ||
409 | if (!(option_mask32 & QUIET)) { | 410 | if (!(option_mask32 & QUIET)) { |
410 | /* inet_ntoa uses static storage, can't use in same printf */ | 411 | /* inet_ntoa uses static storage, can't use in same printf */ |
411 | printf("ARPING to %s", inet_ntoa(dst)); | 412 | printf("ARPING %s", inet_ntoa(dst)); |
412 | printf(" from %s via %s\n", inet_ntoa(src), device); | 413 | printf(" from %s %s\n", inet_ntoa(src), device); |
413 | } | 414 | } |
414 | 415 | ||
415 | signal_SA_RESTART_empty_mask(SIGINT, (void (*)(int))finish); | 416 | signal_SA_RESTART_empty_mask(SIGINT, (void (*)(int))finish); |