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

Upper bound doesn't work properly #96

Closed
PrajwalKrishna opened this issue Dec 9, 2022 · 3 comments
Closed

Upper bound doesn't work properly #96

PrajwalKrishna opened this issue Dec 9, 2022 · 3 comments

Comments

@PrajwalKrishna
Copy link

PrajwalKrishna commented Dec 9, 2022

On running -
new IPAddressString("235.234.5.6/4").getAddress().toPrefixBlock().toIPv4().upperLongValue()

The output is - 3774873599
Whereas, the expected output was - 4026531839

On using the toUpper() I am getting the expected output - 239.255.255.255.
On converting this to toUpper().longValue(), I am getting the expected output - 4026531839

@seancfoley
Copy link
Owner

You are correct, the bug is here where the code grabs the lower and not the upper value for the first segment.

The fix will be delivered in a release quite soon, likely in a few weeks.

In the meantime, you've already identified the work-around.

@PrajwalKrishna
Copy link
Author

Thanks for prompt response.

@seancfoley
Copy link
Owner

This was fixed in version 5.4.0. Closing.

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

No branches or pull requests

2 participants