summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath2003-02-09 07:01:33 +0000
committerGlenn L McGrath2003-02-09 07:01:33 +0000
commita837e2d9b3fe77f8cbddb7c5c50987822b9dc44b (patch)
treee78a691a3b211a18ef338631d9c962fd65843994
parent06e9565b6c365668dafeef1fdc0e60c9a1154623 (diff)
downloadbusybox-a837e2d9b3fe77f8cbddb7c5c50987822b9dc44b.zip
busybox-a837e2d9b3fe77f8cbddb7c5c50987822b9dc44b.tar.gz
Minor update to arping, patch from Nick Fedchik
-rw-r--r--networking/arping.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/networking/arping.c b/networking/arping.c
index af44f92..bf0a77c 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -336,7 +336,7 @@ int arping_main(int argc, char **argv)
exit(socket_errno);
}
- if (1) {
+ {
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
@@ -361,7 +361,7 @@ int arping_main(int argc, char **argv)
}
}
- if (inet_aton(target, &dst) != 1) {
+ if (!inet_aton(target, &dst)) {
struct hostent *hp;
hp = gethostbyname2(target, AF_INET);
@@ -372,7 +372,7 @@ int arping_main(int argc, char **argv)
memcpy(&dst, hp->h_addr, 4);
}
- if (source && inet_aton(source, &src) != 1) {
+ if (source && !inet_aton(source, &src)) {
error_msg("invalid source address %s", source);
exit(2);
}
@@ -436,7 +436,7 @@ int arping_main(int argc, char **argv)
exit(2);
}
- if (1) {
+ {
int alen = sizeof(me);
if (getsockname(s, (struct sockaddr *) &me, &alen) == -1) {
@@ -451,9 +451,11 @@ int arping_main(int argc, char **argv)
he = me;
memset(he.sll_addr, -1, he.sll_halen);
- if (!quiet)
- printf("ARPING to %s from %s via %s\n", inet_ntoa(dst),
- inet_ntoa(src), device ? device : "unknown");
+ if (!quiet) {
+ printf("ARPING to %s", inet_ntoa(dst));
+ printf(" from %s via %s\n", inet_ntoa(src),
+ device ? device : "unknown");
+ }
if (!src.s_addr && !dad) {
error_msg("no src address in the non-DAD mode");