diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-25 19:44:38 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-25 19:44:38 +0000 |
commit | 90ec4dc0c71c6343e45469b3a3bfdd6403dd8de1 (patch) | |
tree | 6b577d9a4b26931daa5f24aa31bd1256aa39053b /networking/arping.c | |
parent | aeb4bdd582d6b11adcdb128d97076101c3c61f1d (diff) | |
download | busybox-w32-90ec4dc0c71c6343e45469b3a3bfdd6403dd8de1.tar.gz busybox-w32-90ec4dc0c71c6343e45469b3a3bfdd6403dd8de1.tar.bz2 busybox-w32-90ec4dc0c71c6343e45469b3a3bfdd6403dd8de1.zip |
arping: stop using last gethostbyname2 in the tree
hostname: small optimization
Diffstat (limited to 'networking/arping.c')
-rw-r--r-- | networking/arping.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/networking/arping.c b/networking/arping.c index 55b27872b..725b0e4cb 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -305,13 +305,11 @@ int arping_main(int argc, char **argv) | |||
305 | } | 305 | } |
306 | 306 | ||
307 | if (!inet_aton(target, &dst)) { | 307 | if (!inet_aton(target, &dst)) { |
308 | struct hostent *hp; | 308 | len_and_sockaddr *lsa; |
309 | 309 | lsa = host_and_af2sockaddr(target, 0, AF_INET); | |
310 | hp = gethostbyname2(target, AF_INET); | 310 | memcpy(&dst, &lsa->sin.sin_addr.s_addr, 4); |
311 | if (!hp) { | 311 | if (ENABLE_FEATURE_CLEAN_UP) |
312 | bb_error_msg_and_die("invalid or unknown target %s", target); | 312 | free(lsa); |
313 | } | ||
314 | memcpy(&dst, hp->h_addr, 4); | ||
315 | } | 313 | } |
316 | 314 | ||
317 | if (source && !inet_aton(source, &src)) { | 315 | if (source && !inet_aton(source, &src)) { |