]> git.gsnw.org Git - fping.git/log
fping.git
6 weeks agoFixes the indentation of the blocks develop
German Service Network [Thu, 23 Apr 2026 16:58:02 +0000 (18:58 +0200)]
Fixes the indentation of the blocks

6 weeks agoSet ipi6_addr in IPV6_PKTINFO when source address is bound
German Service Network [Thu, 23 Apr 2026 16:51:16 +0000 (18:51 +0200)]
Set ipi6_addr in IPV6_PKTINFO when source address is bound

6 weeks agoRemove unnecessary IPV6_RECVPKTINFO setsockopt
German Service Network [Thu, 23 Apr 2026 16:42:54 +0000 (18:42 +0200)]
Remove unnecessary IPV6_RECVPKTINFO setsockopt

6 weeks agoTest asymmetric routing (--oiface)
German Service Network [Wed, 1 Apr 2026 15:14:08 +0000 (17:14 +0200)]
Test asymmetric routing (--oiface)

6 weeks agoFix: set ipi_spec_dst from -S source address in sendmsg()
German Service Network [Sun, 29 Mar 2026 12:18:15 +0000 (14:18 +0200)]
Fix: set ipi_spec_dst from -S source address in sendmsg()

6 weeks agoAdd IPv6 test for --oiface
German Service Network [Sun, 22 Mar 2026 08:44:43 +0000 (09:44 +0100)]
Add IPv6 test for --oiface

6 weeks agoThe --oiface option is not allowed with -I --iface
German Service Network [Sun, 22 Mar 2026 08:08:21 +0000 (09:08 +0100)]
The --oiface option is not allowed with -I --iface

6 weeks agoNew option --oiface for outgoing interface
German Service Network [Sun, 22 Feb 2026 09:35:41 +0000 (10:35 +0100)]
New option --oiface for outgoing interface

6 weeks agoExpansion of README to include docker usage
German Service Network [Tue, 24 Feb 2026 15:45:10 +0000 (16:45 +0100)]
Expansion of README to include docker usage

2 months agoAdd IBM i PASE detection
German Service Network [Fri, 13 Mar 2026 17:00:37 +0000 (18:00 +0100)]
Add IBM i PASE detection

2 months agoci: Update autoconf to version 2.73
German Service Network [Sat, 21 Mar 2026 06:25:16 +0000 (07:25 +0100)]
ci: Update autoconf to version 2.73

4 months agoMove option parsing to a separate file fping.c and fping.h
German Service Network [Sat, 24 Jan 2026 07:06:09 +0000 (08:06 +0100)]
Move option parsing to a separate file fping.c and fping.h

4 months agoMove printing functions and stats functions (global stats) to a separate file
German Service Network [Sat, 17 Jan 2026 08:53:31 +0000 (09:53 +0100)]
Move printing functions and stats functions (global stats) to a separate file

4 months agoMove the most function declarations from fping.c to fping.h
German Service Network [Sun, 11 Jan 2026 09:19:26 +0000 (10:19 +0100)]
Move the most function declarations from fping.c to fping.h

4 months agoavoid crash with option -0
Erik Auerswald [Tue, 13 Jan 2026 08:06:09 +0000 (09:06 +0100)]
avoid crash with option -0

Instead of using the possible option character '0' (ASCII value 0x30)
to indicate a long option without a short alias, use the value 0 as
indicator.  This value is treated specially by the used option parsing
code, and might even be the intended value to use for long-only options.

Before, using option `-0` sometimes, but not always, resulted in a
crash with `Segmentation fault (core dumped)`.

This fixes GitHub issue #456.

4 months agoConsistent variable names for command-line options
German Service Network [Mon, 12 Jan 2026 14:04:53 +0000 (15:04 +0100)]
Consistent variable names for command-line options

4 months agoci: coverity scan check COVERITY_SCAN_TOKEN
German Service Network [Mon, 12 Jan 2026 12:38:20 +0000 (13:38 +0100)]
ci: coverity scan check COVERITY_SCAN_TOKEN

4 months agowork around NetBSD's lack of IP_RECVTOS
Erik Auerswald [Wed, 7 Jan 2026 00:04:13 +0000 (01:04 +0100)]
work around NetBSD's lack of IP_RECVTOS

NetBSD does not know the IP_RECVTOS socket option.  Thus
conditionally compile setting this option only when it is
defined.

This is the same change as used in the NetBSD package[1],
with thanks to "adam".

[1] https://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/fping/patches/patch-src_fping.c?rev=1.5;content-type=text%2Fplain

4 months agoconfigure.ac: improve portability
Erik Auerswald [Tue, 6 Jan 2026 23:47:32 +0000 (00:47 +0100)]
configure.ac: improve portability

Testing string equality using "test" is done with the "="
operator.  Bash also accepts "==", but this is not portable.
The issue was noticed on NetBSD, which uses a patch to the
generated "configure" script[1].

[1] https://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/fping/patches/patch-configure?rev=1.3;content-type=text%2Fplain

5 months agoPerformance: use MSG_DONTWAIT instead of select.
David Schweikert [Fri, 2 Jan 2026 07:49:06 +0000 (08:49 +0100)]
Performance: use MSG_DONTWAIT instead of select.

This also improves a bit the conversion from nanoseconds to
seconds + microseconds.

5 months agoci: Removing travis-ci
German Service Network [Thu, 1 Jan 2026 09:43:03 +0000 (10:43 +0100)]
ci: Removing travis-ci

5 months agoImplement coverity scan with GitHub Action
David Schweikert [Fri, 2 Jan 2026 07:24:37 +0000 (08:24 +0100)]
Implement coverity scan with GitHub Action

5 months agoInclude JSON schema in release tarball
Jan Palus [Thu, 1 Jan 2026 15:17:17 +0000 (16:17 +0100)]
Include JSON schema in release tarball

5 months agoRelease v5.5 v5.5
David Schweikert [Wed, 31 Dec 2025 16:19:30 +0000 (17:19 +0100)]
Release v5.5

5 months agoFix usage pod2man under FreeBSD and OpenBSD
German Service Network [Sun, 28 Dec 2025 14:55:03 +0000 (15:55 +0100)]
Fix usage pod2man under FreeBSD and OpenBSD

5 months agoRelease 5.5-rc2
David Schweikert [Sun, 28 Dec 2025 08:05:21 +0000 (09:05 +0100)]
Release 5.5-rc2

5 months agoReject negative numbers for options requiring positive arguments
David Schweikert [Sat, 27 Dec 2025 09:12:46 +0000 (10:12 +0100)]
Reject negative numbers for options requiring positive arguments

5 months agoReplace sscanf with strtoul/strtod for stricter option parsing
David Schweikert [Wed, 24 Dec 2025 06:41:48 +0000 (07:41 +0100)]
Replace sscanf with strtoul/strtod for stricter option parsing

5 months agoReplace atoi/atof with stroul/strtod
David Schweikert [Wed, 24 Dec 2025 06:17:35 +0000 (07:17 +0100)]
Replace atoi/atof with stroul/strtod

This improves validation of the flag values (so that for example
-c 3foobar is not accepted anymore).

5 months agoci/prepare-linux.sh: do not run setcap unless necessary
David Schweikert [Sat, 27 Dec 2025 07:42:16 +0000 (08:42 +0100)]
ci/prepare-linux.sh: do not run setcap unless necessary

5 months agoSmall code coverage improvements
David Schweikert [Wed, 24 Dec 2025 07:06:32 +0000 (08:06 +0100)]
Small code coverage improvements

5 months agoAdd .local to .gitignore.
David Schweikert [Fri, 26 Dec 2025 09:04:05 +0000 (10:04 +0100)]
Add .local to .gitignore.

Make it easier add files that are ignored when working with git or jj.

5 months agoJSON: rename globalSum to "stats" and avoid spaces in key names.
David Schweikert [Mon, 22 Dec 2025 14:42:11 +0000 (15:42 +0100)]
JSON: rename globalSum to "stats" and avoid spaces in key names.

5 months agoImplement GPG verification of autotools tarballs
David Schweikert [Thu, 25 Dec 2025 10:50:37 +0000 (11:50 +0100)]
Implement GPG verification of autotools tarballs

5 months agoImprove robustness of downloading of autotools tarballs.
David Schweikert [Thu, 25 Dec 2025 08:55:37 +0000 (09:55 +0100)]
Improve robustness of downloading of autotools tarballs.

5 months agoGitHub actions: don't run tests twice for github PRs
David Schweikert [Thu, 25 Dec 2025 09:23:50 +0000 (10:23 +0100)]
GitHub actions: don't run tests twice for github PRs

5 months agoUpdate autotools.
David Schweikert [Thu, 25 Dec 2025 21:41:38 +0000 (22:41 +0100)]
Update autotools.

5 months agoUse SIGINT to kill fping so that coverage data is collected.
David Schweikert [Wed, 24 Dec 2025 07:06:32 +0000 (08:06 +0100)]
Use SIGINT to kill fping so that coverage data is collected.

5 months agoTests performance and robustness fixes.
David Schweikert [Mon, 22 Dec 2025 15:15:55 +0000 (16:15 +0100)]
Tests performance and robustness fixes.

5 months agoci: improve autotools build reliability with ftpmirror and retries
David Schweikert [Wed, 24 Dec 2025 09:11:54 +0000 (10:11 +0100)]
ci: improve autotools build reliability with ftpmirror and retries

5 months agoFix measurement of time for timed reports (-Q) to start after DNS name resolution.
David Schweikert [Mon, 22 Dec 2025 21:33:53 +0000 (22:33 +0100)]
Fix measurement of time for timed reports (-Q) to start after DNS name resolution.

5 months agoPrepare v5.5-rc1 release
David Schweikert [Sun, 21 Dec 2025 17:12:28 +0000 (18:12 +0100)]
Prepare v5.5-rc1 release

5 months agoFix GitHub markdown alert format
David Schweikert [Sat, 20 Dec 2025 08:51:00 +0000 (09:51 +0100)]
Fix GitHub markdown alert format

5 months agoJSON documentation: reformat
David Schweikert [Thu, 18 Dec 2025 17:04:37 +0000 (18:04 +0100)]
JSON documentation: reformat

5 months agoci: Github action Build and Push Docker Image rollback sigstore osign-installer version
German Service Network [Fri, 19 Dec 2025 07:42:08 +0000 (08:42 +0100)]
ci: Github action Build and Push Docker Image rollback sigstore osign-installer version

5 months agoci: Update github action version
German Service Network [Sat, 13 Dec 2025 15:49:11 +0000 (16:49 +0100)]
ci: Update github action version

5 months agoci: Fix test unkown host
German Service Network [Thu, 18 Dec 2025 09:01:22 +0000 (10:01 +0100)]
ci: Fix test unkown host

5 months agoJSON format documentation
David Schweikert [Sun, 7 Dec 2025 12:47:37 +0000 (13:47 +0100)]
JSON format documentation

5 months agojson: simplify recv and timeout output (and code)
David Schweikert [Sun, 7 Dec 2025 18:53:55 +0000 (19:53 +0100)]
json: simplify recv and timeout output (and code)

5 months agoAllow --json also for loop-mode
David Schweikert [Sun, 7 Dec 2025 13:11:22 +0000 (14:11 +0100)]
Allow --json also for loop-mode

6 months agoci: Fix spelling mistake in GitHub action Build and Push Docker Image
German Service Network [Fri, 31 Oct 2025 05:25:02 +0000 (06:25 +0100)]
ci: Fix spelling mistake in GitHub action Build and Push Docker Image

6 months agoci: Start the GitHub action Build and Push Docker Image only when pushing to develop...
German Service Network [Thu, 23 Oct 2025 05:52:05 +0000 (07:52 +0200)]
ci: Start the GitHub action Build and Push Docker Image only when pushing to develop branch

7 months agoRemove double quote from URL Coverity Scan badge
Sebastian [Thu, 2 Oct 2025 14:25:43 +0000 (16:25 +0200)]
Remove double quote from URL Coverity Scan badge

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
7 months agoChange status image from Travis to Github Action
German Service Network [Sun, 28 Sep 2025 07:59:12 +0000 (09:59 +0200)]
Change status image from Travis to Github Action

8 months agoci: Github action Build and Push Docker Image
German Service Network [Tue, 9 Sep 2025 09:54:33 +0000 (11:54 +0200)]
ci: Github action Build and Push Docker Image

8 months agoimprove limits documentation in man page
Erik Auerswald [Sat, 30 Aug 2025 14:31:32 +0000 (16:31 +0200)]
improve limits documentation in man page

* Mention --enable-safe-limits in -i and -p descriptions
* Mention new unconditional limit for -p in option description
* Mention new unconditional limit for -p in limits section
* More consistent formatting in limits section by using B<>
  for the generator options

9 months agoadjust current CHANGELOG.md entries
Erik Auerswald [Sat, 2 Aug 2025 12:29:24 +0000 (14:29 +0200)]
adjust current CHANGELOG.md entries

* add thanks to @hoodadt for the merged pull request
* adjust line lengths using `fmt -c`

9 months agoinitialize all resp_times array entries
Erik Auerswald [Sun, 24 Aug 2025 12:44:08 +0000 (14:44 +0200)]
initialize all resp_times array entries

Before, the resp_times array was initialized starting with the
second entry, leaving the first entry uninitialized.  This is
at least confusing.  Initializing one additional int64_t value
per ping target should not add too much overhead, so do this just
to be on the safe side.

Assuming that the first array entry need not be initialized when
creating the array now, this guards against potential problems
from future code changes that do not take this unexpected special
case into account.

9 months agoPrint receive ping moved to new functions
German Service Network [Sat, 23 Aug 2025 08:50:45 +0000 (10:50 +0200)]
Print receive ping moved to new functions

9 months agoprevent allocation size computation overflow
Erik Auerswald [Sat, 23 Aug 2025 12:52:08 +0000 (14:52 +0200)]
prevent allocation size computation overflow

On systems where size_t is unsigned int, computing the size
of the resp_times array can overflow.  Add a check to prevent
this.

On a 64-bit x86_64 Ubuntu 22.04.5 LTS system, the overflow check
results in a compiler warning:

```
fping.c: In function ‘add_addr’:
fping.c:3444:20: warning: comparison is always false due to limited range of data type [-Wtype-limits]
 3444 |         if (trials > (SIZE_MAX / sizeof(int64_t)))
      |                    ^
```

Thus limit the check to systems with a size_t equal to (or less
than) unsigned int.

9 months agoFix missing escape character in JSON output test
German Service Network [Wed, 20 Aug 2025 11:04:46 +0000 (13:04 +0200)]
Fix missing escape character in JSON output test

9 months agoFix the missing new line character on JSON output for an invalid host warning
German Service Network [Wed, 20 Aug 2025 10:59:14 +0000 (12:59 +0200)]
Fix the missing new line character on JSON output for an invalid host warning

9 months agoFix changelog entry for the new -p lower limit
David Schweikert [Tue, 19 Aug 2025 08:05:27 +0000 (10:05 +0200)]
Fix changelog entry for the new -p lower limit

9 months agoUpdate changelog
David Schweikert [Sun, 17 Aug 2025 21:22:39 +0000 (23:22 +0200)]
Update changelog

9 months agoSafe memory allocation for event storage.
David Schweikert [Sun, 17 Aug 2025 20:42:45 +0000 (22:42 +0200)]
Safe memory allocation for event storage.

- Check calloc return value.
- Make sure that the per-host interval can't be unreasonably low (making the event storage allocation very large).

The issue was reported by David.A.

9 months agoFix off-by-one boundary check in seqmap code
David Schweikert [Sun, 17 Aug 2025 20:48:25 +0000 (22:48 +0200)]
Fix off-by-one boundary check in seqmap code

9 months agoRemove macos-specific test to verify that -I is not supported, since that seems to...
David Schweikert [Tue, 19 Aug 2025 07:11:01 +0000 (09:11 +0200)]
Remove macos-specific test to verify that -I is not supported, since that seems to work now.

Failed test:

```
#   Failed test 'exit_is_num: fping -I lo0 127.0.0.1, 3'
#   at ci/test-07-options-i-m.pl line 63.
#          got: 0
#     expected: 3

#   Failed test 'stdout_is_eq: fping -I lo0 127.0.0.1, fping: cant bind to a particular net interface since SO_BINDTODEVICE is not supported on your os.
# '
#   at ci/test-07-options-i-m.pl line 64.
#          got: '127.0.0.1 is alive
# '
#     expected: 'fping: cant bind to a particular net interface since SO_BINDTODEVICE is not supported on your os.
# '
# Looks like you failed 2 tests of 28.
```

9 months agoUpdate .gitignore
David Schweikert [Sat, 9 Aug 2025 16:22:56 +0000 (18:22 +0200)]
Update .gitignore

10 months agoUpdate Dockerfile
hoodad [Sun, 27 Jul 2025 14:43:01 +0000 (14:43 +0000)]
Update Dockerfile

10 months agoMore Labels
hoodad [Thu, 24 Jul 2025 11:36:38 +0000 (11:36 +0000)]
More Labels

10 months agoFixed Dockerfile Typo
hoodad [Thu, 24 Jul 2025 10:42:48 +0000 (10:42 +0000)]
Fixed Dockerfile Typo

10 months agoUpdate CHANGELOG.md
hoodad [Thu, 24 Jul 2025 10:40:20 +0000 (10:40 +0000)]
Update CHANGELOG.md

10 months agoUpdate Dockerfile
hoodadt [Mon, 21 Jul 2025 11:41:17 +0000 (15:11 +0330)]
Update Dockerfile

10 months agoBetter Dockerfile
hoodad [Mon, 21 Jul 2025 11:54:53 +0000 (11:54 +0000)]
Better Dockerfile

10 months agoBetter Dockerfile
hoodad [Mon, 21 Jul 2025 11:46:29 +0000 (11:46 +0000)]
Better Dockerfile

10 months agosuppress duplicate reports with -c/-C and -q/-Q
Erik Auerswald [Sun, 4 May 2025 16:09:48 +0000 (18:09 +0200)]
suppress duplicate reports with -c/-C and -q/-Q

If fping receives a duplicate Echo Reply packet, it reports
this.  This report was suppressed for loop mode, and for
other operating modes where each receive event is reported.
Now, this duplicate report is also suppressed when in count
mode with options -q, --quiet or -Q, --squiet.

This addresses GitHub issue #389.

10 months agofix ICMPv6 error message handling and reporting
Erik Auerswald [Sun, 4 May 2025 15:44:29 +0000 (17:44 +0200)]
fix ICMPv6 error message handling and reporting

Handling of received ICMPv6 messages different from Echo Reply
was based on IPv4 code.  It would thus use a too small minimum
size, and interpret the wrong data as ICMPv6 fields.  Thus
received ICMPv6 error messages were either not reported at all,
or were reported incorrectly.

This commit introduces the following changes to fix this and thus
address GitHub issue #390:

- Filter out irrelevant ICMPv6 messages: fping needs to receive
  ICMPv6 Echo Reply and ICMPv6 error messages, nothing else
  (only relevant for raw sockets).
- Fix offset calculation to look at the included packet that
  caused this ICMPv6 error message.
- Ignore invoking packets that do not have ICMPv6 as the first
  IPv6 Next Header in the packet (there could be, e.g., IPv6
  Extension Headers).
- Fix ICMPv6 message type determination, and print respective
  warning messages.

10 months agoEntry for JSON output in the changelog
German Service Network [Sun, 25 May 2025 07:03:44 +0000 (09:03 +0200)]
Entry for JSON output in the changelog

10 months agoChange of the JSON return text if -c or -C was not specified
German Service Network [Wed, 30 Apr 2025 19:56:03 +0000 (21:56 +0200)]
Change of the JSON return text if -c or -C was not specified

10 months agooptparse_long for json changed to OPTPARSE_NONE
German Service Network [Wed, 30 Apr 2025 17:28:42 +0000 (19:28 +0200)]
optparse_long for json changed to OPTPARSE_NONE

10 months agoAdd JSON support for --timestamp-format
German Service Network [Wed, 30 Apr 2025 17:19:25 +0000 (19:19 +0200)]
Add JSON support for --timestamp-format

10 months agoFix JSON output print_per_system_stats_json dash to null
German Service Network [Wed, 30 Apr 2025 16:39:15 +0000 (18:39 +0200)]
Fix JSON output print_per_system_stats_json dash to null

10 months agoAdd JSON timeout event type
German Service Network [Sat, 26 Apr 2025 17:39:30 +0000 (19:39 +0200)]
Add JSON timeout event type

10 months agoFormat change for handle JSON output for invalid hosts
German Service Network [Sat, 26 Apr 2025 09:45:02 +0000 (11:45 +0200)]
Format change for handle JSON output for invalid hosts

10 months agoNew option -J / --json for the JSON output
German Service Network [Sun, 20 Apr 2025 17:34:21 +0000 (19:34 +0200)]
New option -J / --json for the JSON output

10 months agoci: Fix forgotten github action codeql init v3
German Service Network [Tue, 8 Jul 2025 05:03:43 +0000 (07:03 +0200)]
ci: Fix forgotten github action codeql init v3

10 months agoci: Change codeql deprected action v2 to v3
German Service Network [Fri, 27 Jun 2025 14:43:05 +0000 (16:43 +0200)]
ci: Change codeql deprected action v2 to v3

11 months agonew option --seqmap-timeout=MSEC
Erik Auerswald [Mon, 21 Apr 2025 18:02:17 +0000 (20:02 +0200)]
new option --seqmap-timeout=MSEC

This allows to control the time after which sequence numbers
can be reused for new probe packets.  This is intended to
help using count or loop modes with tens of thousands of
target hosts.

See GH issue #385 for more information.

11 months agoprint TOS & TTL also for IPv6 and w/o privileges
Erik Auerswald [Sun, 9 Mar 2025 19:28:42 +0000 (20:28 +0100)]
print TOS & TTL also for IPv6 and w/o privileges

When using IPv4 raw sockets, fping has access to the received
IP packet data including the IP header.  This allows to simply
read the TOS byte and/or TTL value from the IP header.

But, using IPv4 raw sockets requires privileges.  Additionally,
IPv6 raw sockets do not provide access to the IPv6 header.

For IPv6, or when using IPv4 datagram sockets, i.e., when fping
runs without privileges, a different method needs to be used to
access TOS / TC and TTL / Hop Count of received packets.  The
so called "control messages", also called "ancillary data", can
be used for this.  This requires several actions:

* set the respective socket options to request additional data,
* ensure the buffer used to receive additional data is sized
  large enough,
* read and process the requested additional data.

12 months agoFix: OpenBSD sprintf warning
German Service Network [Sat, 17 May 2025 19:33:19 +0000 (21:33 +0200)]
Fix: OpenBSD sprintf warning

12 months agofix build without IPv6 support
Erik Auerswald [Sun, 11 May 2025 17:11:14 +0000 (19:11 +0200)]
fix build without IPv6 support

In commit 57d91b13f20529a23df8c29eaf612d8483e318d8, I missed
one set of "#ifdev IPV6 ... #endif" guards for a piece of code
only relevant for IPv6 support in the generator.  This broke
the build with --disable-ipv6, or without IPv6 support on the
build system.

12 months agorestore inadvertantly removed IPv4 test for -k
Erik Auerswald [Sat, 26 Apr 2025 16:19:13 +0000 (18:19 +0200)]
restore inadvertantly removed IPv4 test for -k

This was removed in an commit by me that should only have added
a new test (commit 4160d03a2653684b37a776744095aac43f7efc88).

13 months agoci: Change github action unsupported ubuntu-20.04
German Service Network [Fri, 18 Apr 2025 07:22:09 +0000 (09:22 +0200)]
ci: Change github action unsupported ubuntu-20.04

14 months agofix debug build use of dbg_printf in fping.c
Erik Auerswald [Sat, 8 Mar 2025 19:02:53 +0000 (20:02 +0100)]
fix debug build use of dbg_printf in fping.c

config.h must be include before fping.h, because
configure --enable-debug writes the DEBUG #define
to config.h, and the dbg_printf macro definition
requires a defined DEBUG to actually produce any
output.

Unbreaking dbg_printf() exposed an instance of
wrong use, so fix that.  Also, add a newline to
the debug output reporting used CPU time.

14 months agotest that --icmp-timestamp requires privileges
Erik Auerswald [Sat, 8 Mar 2025 18:45:14 +0000 (19:45 +0100)]
test that --icmp-timestamp requires privileges

14 months agofix typo in S_BINDTODEVICE error message
Erik Auerswald [Sat, 8 Mar 2025 18:30:48 +0000 (19:30 +0100)]
fix typo in S_BINDTODEVICE error message

Also, add tests with -I.  In the currently use GitHub CI
system, only GNU/Linux supports this option.  But, network
device names other than "lo" change too often on GNU/Linux
to know in advance what an interface might be called.  This
limits what can be reliably tested.

14 months agohandle long input lines when reading from file
Erik Auerswald [Sun, 26 Jan 2025 19:48:25 +0000 (20:48 +0100)]
handle long input lines when reading from file

This addresses GitHub isse #377.

Before, input lines longer than the static buffer used to read
data would be handled as if each buffer part were one line.
This could result in splitting input target names into multiple
different target names.

Since the static buffer was significantly smaller then the maximum
length of DNS names (just short of 255 one octet characters),
valid long DNS names could not be read as targets via file.

This commit fixes the splitting of long lines, and also increases
the maximum length of target names to 255 one octet characters.

The additional line parsing code is kept similar to the existing
code and attempts to keep all intended and/or useful features to
minimize the risk of regressions.

14 months agotests for useful input file features
Erik Auerswald [Fri, 24 Jan 2025 21:45:26 +0000 (22:45 +0100)]
tests for useful input file features

* whitespace in sufficiently short lines is skipped
* additional words after the target are ignored in sufficiently
  short lines
* whitespace-only (i.e., blank, but not empty) lines are skipped
* DOS-format text files, i.e., lines terminated with CRLF, work
* input need not be a correct POSIX text file, i.e., non-empty
  input does not need to end with LF

15 months agoIPv6 support for -g, --generate
Erik Auerswald [Wed, 15 Jan 2025 16:42:12 +0000 (17:42 +0100)]
IPv6 support for -g, --generate

The limit for generated addresses is increased by two to
allow /111 IPv6 prefixes similar to /15 IPv4 prefixes.

The implementation uses two unsigned 64 bit integers to
represent a single IPv6 address.  The required arithmetic
is open-coded and limited to what is needed to implement
IPv6 support for -g, --generate.

This addresses GitHub issue #59.

15 months agoreorganize add_cidr()/add_range()
Erik Auerswald [Sun, 12 Jan 2025 09:58:53 +0000 (10:58 +0100)]
reorganize add_cidr()/add_range()

This creates a code structure suitable to add IPv6 versions
of the functions used to generate addresses.