From: David Schweikert Date: Tue, 30 Sep 2014 13:07:44 +0000 (+1000) Subject: Revert 'get all addresses' change for now X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=039c8b0645e8e8a5b14f50960808c6d152fd8bf7;p=fping.git Revert 'get all addresses' change for now --- diff --git a/ChangeLog b/ChangeLog index 8956f90..62dab00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,4 @@ 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 support both IPv4 and IPv6 with the same binary * Fix double entries with fping -u and unreachable hosts diff --git a/src/fping.c b/src/fping.c index ee759b5..8651080 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1913,7 +1913,13 @@ void add_name( char *name ) num_noaddress++; 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; /* name_flag: addr -> name lookup requested) */ if(!name_flag) { @@ -1958,6 +1964,8 @@ void add_name( char *name ) else { add_addr(name, printname, res->ai_addr, res->ai_addrlen); } + + return; } } /* add_name() */