Commit Graph

703 Commits (062d6419d64fe5f320b289bba101c07f74b597e5)
 

Author SHA1 Message Date
Raphael 062d6419d6 Merge branch 'develop-eduard' into develop 5 months ago
Erik Auerswald 00d6417104 adjust generator limit to allow an IPv4 /15 6 months ago
Erik Auerswald a1509c1b4d fix off-by-one error in generator limit
This commit does not add tests that verify the exact limit,
because pinging 100000 localhost addresses takes over 15
minutes on my PC.  I have tested this fix manually.
6 months ago
Erik Auerswald 54e6f838c3 also apply generator limit to use with CIDR
As described in GH issue #299, the MAX_GENERATE+1 limit is only
applied when using an address range, not when using CIDR.  This
commit changes this to always honor the generator limit.

* refactor target address generation to use the same new function
  for both range and CIDR notation
* check the limit for addresses to generate in the new function
* document the generator limit in "fping --help" output
* document the generator limit in the fping man page
* test that the address generation limit applies when using CIDR
  notation
6 months ago
Erik Auerswald d0ed64bcc7 align functions add_cidr() and add_range()
* call freeaddrinfo() before checking the prefix length in
  add_cidr()
* add a comment to the generator limit check in add_range()
6 months ago
Erik Auerswald ab20b150b8 ci: skip an unreliable test on macOS
Sometimes, this test fails on macOS, at least on the GitHub CI.
It looks as if the fping process is killed before it produces
the required output.  This test works reliably on GNU/Linux, so
keep it, but skip it when running on macOS.
6 months ago
Erik Auerswald 65f00ff013 ci: test timestamp plausibility
Some changes of fping resulted in some systems reporting
implausible timestamps, see, e.g., GH issue #203.  This
commit adds a simplistic plausability check for timestamps
in Unix time format: they need to be greater or equal to
1000000000 (2001-09-09 03:46:40+02:00).
6 months ago
Erik Auerswald a333f95c9d ci: test empty string argument instead of number
Giving an empty string instead of a number as option argument
was not reliably caught, see GH issue #324 and GH PR #323.
6 months ago
German Service Network 94de79153f Fix incorrect return-value check for a scanf like function 6 months ago
German Service Network 118cdc5cc6 configure.ac check required function strftime 6 months ago
German Service Network b39f5a5cef Extended dokumentation for parameter timestamp-format 6 months ago
German Service Network aa724910b8 Test 05 for --timestamp-format extended 6 months ago
German Service Network 85b92d3d21 New parameter timestamp-format for changing the timestamp output 6 months ago
German Service Network 652d319803 Handling optparse long option 6 months ago
German Service Network 2f2ff0bd2c Change to codeql-action-v2 7 months ago
German Service Network 46793cdf80 Debug with Visual Studio Code 7 months ago
Erik Auerswald 97b7484350 test error when binding to wrong local address
Test "fping -S" with both IPv4 and IPv6 addresses not configured
on local interfaces using addresses reserved for documentation.
Check the fping error message, but accept any system generated
additional information.  This additional information differs
between operation systems.
7 months ago
Erik Auerswald 79e274d4b8 test help output during normal option parsing
The existing test for "fping -h" triggers the special code path
for only one option, either -h or --help, that is handled before
normal option parsing.
7 months ago
Eduard Vlad 11a48b4de1 add nonzero flag instead of random data for accessing it 7 months ago
Erik Auerswald 90ad83fbd0 Print cumulative stats with -Q SECS,cumulative
With -Q SECS, fping emits information for the just finished
interval.  This is good for long-running fping processes where
one would like to get an update on recent results, ignoring
missing responses from older intervals.  This seems appropriate
for use with other software like netdata or smokeping.

But for short(er)-running fping processes, e.g., during a change
window, it may be more interesting to get a status update since
the beginning of the change window, i.e., the start of fping.
Adding a comma followed by the keyword "cumulative" to -Q SECS
(i.e., -Q SECS,cumulative) changes the interim reports to output
the current per system overall statistics, unless -N is used, too.

The new syntax is documented in fping.pod and added to fping -h
output.

Four tests are added:

  1. Characters after SECS are ignored as before.
  2. Unknown keywords are ignored as before.
  2. Adding ",cumulative" changes -Q output.
  3. Adding ",cumulative" also affects the additional -o output.

This addresses issue #243.
8 months ago
dwes 0d08321346 Prepare v5.2 release. 8 months ago
German Service Network bd44c9f016 Removes the unnecessary file 18 8 months ago
German Service Network f71e40ab60 Extended configure.ac with --enable-debug and create debug output cpu time use 9 months ago
German Service Network 5a2a23d2af Update Azure Pipline add macOS pipline job 9 months ago
German Service Network 47c0c3d8de Update Azure Pipline linux test based on github pipline with matching exclude 9 months ago
David Schweikert ab05279782 Fix number of tests 9 months ago
David Schweikert d6d9c653eb Remove flaky test for now.
Remove the 'fping -X 2 --generate 8.8.0.0/29' test, because it
is currently failing on the MacOS runner. Also, I am not sure that
it is a good idea to ping the IPs 8.8.0.1 and 8.8.0.2 and rely on
them being up.
9 months ago
German Service Network 94e98acaaa Check if the variable next_value->ping_ts != 0 in seqmap_add() 9 months ago
Erik Auerswald c3a2f2c7cc always output error message in crash_and_burn()
This aligns crash_and_burn() with errno_crash_and_burn()
and addresses issue #300.
10 months ago
Erik Auerswald 4151976986 improve help output for options -c and -C 10 months ago
Erik Auerswald 266eb16568 use function stats_reset_interval()
Git commit bb8d71ef27 from 2020 among many
other things introduced the function stats_reset_interval() to reset the
*_i interval (or split) host statistics, but did not use it.  This commit
replaces the open coded reset of interval stats inside print_host_splits()
and print_netdata() with calling stats_reset_interval().
10 months ago
Erik Auerswald c138b08141 typo fixes pertaining to ICMP for IPv6 sockets
As mentioned in issue #300, error messages pertaining to
socket creation may not be printed.  But they should be
corrected anyway, just as the comments.  Having correct
error messages also makes a fix for issue #300 more
obvious, because the messages itself would not change.
10 months ago
Erik Auerswald ae0bc23804 Document that -c N overrides -a or -u 10 months ago
Erik Auerswald 1443614dad Decouple -a/-u effects from -c
As described in issue #295, the option combinations "-c N -u"
and "-c N -a" inadvertently have the same effect as "-c N -q".
Prevent this by first acting on -c, which includes disabling
either -a or -u, if -c is given, before acting on -a/-u.
10 months ago
Erik Auerswald c122186f70 Move description of -i MSEC to probing options
The -i MSEC, --interval=MSEC option does not directly affect
the output format, but rather the probe generation, i.e., the
minimum time between probes.  Thus it is more fitting to list
it under "probing options" than under "output options".
10 months ago
Erik Auerswald d312a278d5 Test ping to "all IPv6 nodes" multicast address
Any Echo Response packet uses a different source address than
used for the target, because it is not allowed to use a multicast
address as source.  This results in extra output in a specific
format on standard error.

This should work, because IPv6 requires multicast support, and
every IPv6 node is supposed to join the "all nodes" multicast
group, including the node the test runs on.  It at least works
on my Ubuntu 20.04 LTS system.
11 months ago
Erik Auerswald ef74f642d1 Test edge cases of -f and -g
* -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
11 months ago
Erik Auerswald 32b9a55a98 Test -l together with -Q or -t 11 months ago
Erik Auerswald dcda0cc595 Test that -x, -X, -k require numeric argument 11 months ago
Erik Auerswald c5428391a6 Test that negative numbers are not accepted 11 months ago
Erik Auerswald 8ae2babae0 Fix a comment describing a test 11 months ago
Erik Auerswald 290d944b56 Defensive coding: guard against a division by zero
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.
11 months ago
Erik Auerswald e4bae43d66 Update exit status description in man page
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.
11 months ago
Erik Auerswald 2a609b856d Test examples from man page
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.
12 months ago
Erik Auerswald 3a527fbc86 Add test for option combination -Q SECS -o
The -o option adds outage duration to the periodic reports.
Each report shows the outage since the last report, not since
the beginning.
12 months ago
Erik Auerswald 4753437b17 Add longer test for -Q SECS
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.
12 months ago
Erik Auerswald ccc0cdfdd7 Test that -g does not accept IPv6 12 months ago
Erik Auerswald 2fa4f61079 Test edge case behavior of "fping -g"
* 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.
12 months ago
deepkv c8e9632150 Add --fwmark/-k option for Linux 12 months ago
German Service Network a3f4c573bf Change obsolete macro from AC_CANONICAL_SYSTEM to AC_CANONICAL_TARGET 1 year ago