Revert 'get all addresses' change for now

pull/82/head
David Schweikert 10 years ago
parent 27c91fe0d4
commit 039c8b0645

@ -1,6 +1,4 @@
UNRELEASED UNRELEASED
* INCOMPATIBLE CHANGE: when a name with multiple IPs is provided, fping will
now ping all addresses (instead of just the first one)
* Use sockaddr_storage and simplify code, so that we can one day * Use sockaddr_storage and simplify code, so that we can one day
support both IPv4 and IPv6 with the same binary support both IPv4 and IPv6 with the same binary
* Fix double entries with fping -u and unreachable hosts * Fix double entries with fping -u and unreachable hosts

@ -1913,7 +1913,13 @@ void add_name( char *name )
num_noaddress++; num_noaddress++;
return; return;
} }
for (res = res0; res; res = res->ai_next) {
// NOTE: we could/should loop with res on all addresses like this:
// for (res = res0; res; res = res->ai_next) {
// We don't do it yet, however, because is is an incompatible change
// (need to implement a separate option for this)
for (res = res0; res; res = 0) {
len = res->ai_addrlen; len = res->ai_addrlen;
/* name_flag: addr -> name lookup requested) */ /* name_flag: addr -> name lookup requested) */
if(!name_flag) { if(!name_flag) {
@ -1958,6 +1964,8 @@ void add_name( char *name )
else { else {
add_addr(name, printname, res->ai_addr, res->ai_addrlen); add_addr(name, printname, res->ai_addr, res->ai_addrlen);
} }
return;
} }
} /* add_name() */ } /* add_name() */

Loading…
Cancel
Save