aboutsummaryrefslogtreecommitdiff
path: root/networking/arping.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-05-26 21:35:46 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-05-26 21:35:46 +0200
commit852e8dd734662d80aa82be802b066130af85b261 (patch)
treed53d17f5fa8affbe1c93f6e03cce4b4822ae93a6 /networking/arping.c
parentf2559e5c2b7bd2c5fa0dd8e88d0a931da92a23af (diff)
downloadbusybox-852e8dd734662d80aa82be802b066130af85b261.tar.gz
arping: avoid use of ether_ntoa(). Closes 8926
This is the only non-debug use of ether_ntoa(). By not using it, we reduce bss: function old new delta arping_main 1568 1665 +97 static.asc 18 - -18 ether_ntoa 57 - -57 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 1/0 up/down: 97/-75) Total: 22 bytes text data bss dec hex filename 911020 493 7352 918865 e0551 busybox_old 911069 493 7336 918898 e0572 busybox_unstripped Also, "standard" arping zero-pads MAC. ether_ntoa() does not. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/arping.c')
-rw-r--r--networking/arping.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/networking/arping.c b/networking/arping.c
index 6b0de4de2..4f207eaa5 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) {