X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Farping.c;h=46bd65e3610207e9c0ed8fa89c454780f0bdcf9e;hb=b6d421b635670939e4ec047543f84cb507e5fe9d;hp=6b0de4de290bd6b9524228523b118253a712bed0;hpb=47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5;p=oweals%2Fbusybox.git diff --git a/networking/arping.c b/networking/arping.c index 6b0de4de2..46bd65e36 100644 --- a/networking/arping.c +++ b/networking/arping.c @@ -231,20 +231,23 @@ static void recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM) if (!(option_mask32 & QUIET)) { int s_printed = 0; - printf("%scast re%s from %s [%s]", + printf("%scast re%s from %s [%02x:%02x:%02x:%02x:%02x:%02x]", FROM->sll_pkttype == PACKET_HOST ? "Uni" : "Broad", ah->ar_op == htons(ARPOP_REPLY) ? "ply" : "quest", inet_ntoa(src_ip), - ether_ntoa((struct ether_addr *) p)); + p[0], p[1], p[2], p[3], p[4], p[5] + ); if (dst_ip.s_addr != src.s_addr) { printf("for %s ", inet_ntoa(dst_ip)); s_printed = 1; } if (memcmp(p + ah->ar_hln + 4, me.sll_addr, ah->ar_hln)) { + unsigned char *pp = p + ah->ar_hln + 4; if (!s_printed) printf("for "); - printf("[%s]", - ether_ntoa((struct ether_addr *) p + ah->ar_hln + 4)); + printf("[%02x:%02x:%02x:%02x:%02x:%02x]", + pp[0], pp[1], pp[2], pp[3], pp[4], pp[5] + ); } if (last) { @@ -292,8 +295,8 @@ int arping_main(int argc UNUSED_PARAM, char **argv) /* Dad also sets quit_on_reply. * Advert also sets unsolicited. */ - opt_complementary = "=1:Df:AU:c+"; - opt = getopt32(argv, "DUAqfbc:w:I:s:", + opt_complementary = "=1:Df:AU"; + opt = getopt32(argv, "DUAqfbc:+w:I:s:", &count, &str_timeout, &device, &source); if (opt & 0x80) /* -w: timeout */ timeout_us = xatou_range(str_timeout, 0, INT_MAX/2000000) * 1000000 + 500000;