summaryrefslogtreecommitdiff
path: root/networking/udhcp/arpping.c
diff options
context:
space:
mode:
authorDenys Vlasenko2021-06-03 11:32:40 +0200
committerDenys Vlasenko2021-06-03 11:32:40 +0200
commit0d15d5bccabff2a46b5da360b07c1ae1909b37b8 (patch)
tree273e0695f7c16e168af98db9dd0b52ada99e55a2 /networking/udhcp/arpping.c
parent774020c224653590110b30ea461d0ead34a6d875 (diff)
downloadbusybox-0d15d5bccabff2a46b5da360b07c1ae1909b37b8.zip
busybox-0d15d5bccabff2a46b5da360b07c1ae1909b37b8.tar.gz
udhcp: shrink arpping()
function old new delta .rodata 103249 103246 -3 arpping 437 420 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-20) Total: -20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/arpping.c')
-rw-r--r--networking/udhcp/arpping.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c
index a395e83..a11c4e8 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -47,6 +47,7 @@ int FAST_FUNC arpping(uint32_t test_nip,
int rv = 1; /* "no reply received" yet */
struct sockaddr addr; /* for interface name */
struct arpMsg arp;
+ const char *msg;
if (!timeo)
return 1;
@@ -58,7 +59,7 @@ int FAST_FUNC arpping(uint32_t test_nip,
}
if (setsockopt_broadcast(s) == -1) {
- bb_simple_perror_msg("can't enable bcast on raw socket");
+ bb_simple_perror_msg("can't enable bcast on ARP socket");
goto ret;
}
@@ -131,6 +132,9 @@ int FAST_FUNC arpping(uint32_t test_nip,
ret:
close(s);
- log1("%srp reply received for this address", rv ? "no a" : "A");
+ msg = "no ARP reply received for this address";
+ if (rv == 0)
+ msg += 3;
+ log1s(msg);
return rv;
}