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

Generator limit #331

Merged
merged 4 commits into from
Jul 12, 2024
Merged

Generator limit #331

merged 4 commits into from
Jul 12, 2024

Conversation

auerswal
Copy link
Collaborator

@auerswal auerswal commented Jul 7, 2024

This pull request addresses GitHub issue #299 by:

  • using the same maximum number of generated addresses for both range and CIDR arguments,
  • fixing the off-by-one error in the generator limit, and
  • increasing the limit to allow a 15-bit IPv4 prefix as generator input, or a range of the same size.

The generator limit is not exactly tested via CI, because pinging 100000 (or 100001) localhost IPv4 addresses takes more than 15 minutes on my computer. Testing 2^17-2 localhost IPv4 addresses takes more than 20 minutes on my computer. Thus I have tested this only manually.

* call freeaddrinfo() before checking the prefix length in
  add_cidr()
* add a comment to the generator limit check in add_range()
As described in GH issue schweikert#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
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.
@coveralls
Copy link

Coverage Status

coverage: 85.622%. remained the same
when pulling e6a6077 on auerswal:generator_limit
into ab20b15 on schweikert:develop.

Copy link
Owner

@schweikert schweikert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@auerswal auerswal merged commit 00d6417 into schweikert:develop Jul 12, 2024
9 checks passed
@auerswal auerswal deleted the generator_limit branch July 12, 2024 16:19
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.

Inconsistent limits for address generation via -g, --generator using either range or CIDR
3 participants