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() */