Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 support for -g, --generate #376

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

auerswal
Copy link
Collaborator

No description provided.

Before, "fping -6 -g IPv4_ADDR_SPEC" would generate all requested
IPv4 addresses and try to add them to the host table, but that
would fail because of address family mismatch.

Now, "fping -6 -g IPv4_ADDR_SPEC" detects the problem before
generating any addresses, and fails early.

Mixing IPv4 and IPv6 addresses when using -g START END is detected
before generating any addresses and fails early, too.
This creates a code structure suitable to add IPv6 versions
of the functions used to generate addresses.
Similarly to IPv4, using CIDR notation excludes a special
per-subnet address, the Subnet-Router anycast address.

The limit for generated addresses is increased by one 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 schweikert#59.
@auerswal auerswal linked an issue Jan 19, 2025 that may be closed by this pull request
@coveralls
Copy link

Coverage Status

coverage: 87.629% (+0.03%) from 87.602%
when pulling 3c2b44e on auerswal:ipv6-gen
into cb83286 on schweikert:develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please allow -g at least for smaller IPv6 ranges
2 participants