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

fix incorrect IP address range calculation when using /0 prefix (#484) #486

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

mbcdev
Copy link
Contributor

@mbcdev mbcdev commented Aug 26, 2022

According to the C/C++ Standard, for shift operations, the behavior is undefined if the right operand is equal to the width of the promoted left operand.
On a 64-bit Windows machine, this causes IP addresses 0.0.0.0 and 255.255.255.255 to have the same internal representation, leading to various issues when using a /0 prefix.

…tanini#484)

According to the C/C++ Standard, for shift operations, the behavior is undefined if the right operand is equal to the width of the promoted left operand.
On a 64-bit Windows machine, this causes IP addresses 0.0.0.0 and 255.255.255.255 to have the same internal representation, leading to various issues when using a /0 prefix.
@rectified95
Copy link

rectified95 commented Aug 30, 2022

@mbcdev Sorry about this totally unrelated question but there seems to be very little traffic on this repo otherwise - I assume you're able to use libtins in an app.
I'm getting an error about missing wpcap.dll (like this one: #380)
and wonder how to mitigate it.
Did you encounter this issue during development?

@mfontanini mfontanini merged commit eb997f5 into mfontanini:master Aug 30, 2022
@mfontanini
Copy link
Owner

Thanks for the fix! @rectified95 there's not much traffic but this library is working fine and you can use it in applications. There's some companies using it in their products :)

laudrup pushed a commit to laudrup/libtins that referenced this pull request Nov 23, 2022
…tanini#484) (mfontanini#486)

According to the C/C++ Standard, for shift operations, the behavior is undefined if the right operand is equal to the width of the promoted left operand.
On a 64-bit Windows machine, this causes IP addresses 0.0.0.0 and 255.255.255.255 to have the same internal representation, leading to various issues when using a /0 prefix.
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.

None yet

3 participants