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

match IPv4MappedToIPv6 address in IPv4 networks #103381

Merged
merged 4 commits into from
Jun 17, 2024
Merged

match IPv4MappedToIPv6 address in IPv4 networks #103381

merged 4 commits into from
Jun 17, 2024

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Jun 12, 2024

fixes #98427.
This change does exactly what #98427 asked for. e.g. if there IPv4 IPNetwork Pv4-Mapped IPv6 Addresses address would function same as it's IPv4 equivalent. This prevents hassle and allocations from IPAddress.MapToIPv4 one would have to use.

Note that this is not symmetric. e.g. if somebody would create IPNetwork with ::ffff:192.168.0.0/24 IPv4 address would not match that at the moment. We can fix that if we want to @MihaZupan and @antonfirsov. But I;'m not sure if there is compelling use case. (I can see one for the address from DualMode Socket)

@wfurt wfurt added this to the 9.0.0 milestone Jun 12, 2024
@wfurt wfurt self-assigned this Jun 12, 2024
Copy link

@MihuBot MihuBot left a comment

Choose a reason for hiding this comment

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

Thanks.
I agree this should be the more common direction (IPv4 IPNetwork + DualMode addresses to test).

Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

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

Oops :)

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

Successfully merging this pull request may close these issues.

IPNetwork.Contains for IPv4 networks should match IPv4-Mapped IPv6 Addresses
4 participants