* -f with non-existing file
* -f with input file containing comment and empty line
* -g with non-numeric address in "CIDR" format
* -g with one non-numeric address in start resp. end position
* -g with one IPv6 address in start resp. end position
In the function print_per_system_stats(), if packets have been
lost, the number of sent packets is checked to be positive before
dividing by it. If no packets have been lost, this is not checked.
Either the existing check is not needed, or both code paths need
the check.
The function print_per_system_splits() is quite similar to
print_per_system_stats(), and has the equivalent guards against a
division by zero in both code paths, not just one of them.
In the spirit of defensive coding, I think it is better to be safe
and add the missing guard against a division by zero.
With the options -x and -X, fping does not require all hosts to
be reachable for an exit status of 0.
This addresses a comment in issue #99 suggesting such a man page
update.
The man page gives two examples combining -C and -q, but
these combinations are not yet tested. Add tests to help
ensure the documented examples continue to work.
The statistics printed every SECS seconds show the results
since the the last report, not since the beginning. Also,
every report starts with a timestamp.
* wrong number or kind of arguments fails and prints usage;
* an empty range silently pings nothing and fping returns 1;
* a too large range fails with an error message;
* a zero CIDR prefix length fails with an error message.
Initializing the structure assuming glibc layout results in
compile errors on musl, therefore do partial intialization and then
assigning the members individually.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
The `-Q, --squiet=SECS` option does not replace the summary
statistics of `-q, --quiets`, but adds interval summary
statistics every SECS seconds to the output.
* Adjust `fping.pod` entries for `-d, --rdns` and `-n, --name`:
* The code performs reverse DNS lookups on the given targets,
not on source addresses from ICMP Echo Responses or ICMP
error messages. Adjust the `-d` description to reflect this.
* The sentence describing `-n` seems incomplete, so provide a
completion in similar spirit to `-d`.
* Add `-d, --rdns` to `-h, --help` output since `-d` and `-n` are
no longer equivalent.