Conversation
|
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
| | multicast_realm_local | ||
| | multicast_site_local | ||
| | multicast_organization_local; | ||
| let ipv4_mapped = 1 << 17; |
There was a problem hiding this comment.
I assigned ipv4_mapped to 1 << 17, as I already assigned 1 << 16 to benchmarking in the related PR #86434. (the actual values don't really matter, only that they are distinct)
| check!( | ||
| "::ffff:127.0.0.1", | ||
| &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0x7f, 0, 0, 1], | ||
| global | unicast_global | ipv4_mapped |
There was a problem hiding this comment.
According to the IANA IPv6 Special Address Registry IPv4-mapped addresses are not globally reachable. However due to the current simplistic implementation of Ipv6Addr::is_global compared to Ipv4Addr::is_global, Rust currently considers these addresses global. I plan to address this in a future PR reworking is_global.
There was a problem hiding this comment.
The rework of Ipv6Addr::is_global has been submitted (#86634).
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #86335) made this pull request unmergeable. Please resolve the merge conflicts. |
|
ping from triage: |
This change consists of cherry-picking the content from the original PR[1], which got closed due to inactivity, and applying the following changes: * Resolving merge conflicts (obviously) * Linked to to_ipv4_mapped instead of to_ipv4 in the documentation (seems more appropriate) * Added the must_use and rustc_const_unstable attributes the original didn't have I think it's a reasonably useful method. [1] rust-lang#86490
Add Ipv6Addr::is_ipv4_mapped This change consists of cherry-picking the content from the original PR[1], which got closed due to inactivity, and applying the following changes: * Resolving merge conflicts (obviously) * Linked to to_ipv4_mapped instead of to_ipv4 in the documentation (seems more appropriate) * Added the must_use and rustc_const_unstable attributes the original didn't have I think it's a reasonably useful method to have. [1] rust-lang#86490
Rollup merge of rust-lang#119081 - jstasiak:is-ipv4-mapped, r=dtolnay Add Ipv6Addr::is_ipv4_mapped This change consists of cherry-picking the content from the original PR[1], which got closed due to inactivity, and applying the following changes: * Resolving merge conflicts (obviously) * Linked to to_ipv4_mapped instead of to_ipv4 in the documentation (seems more appropriate) * Added the must_use and rustc_const_unstable attributes the original didn't have I think it's a reasonably useful method to have. [1] rust-lang#86490
Add Ipv6Addr::is_ipv4_mapped This change consists of cherry-picking the content from the original PR[1], which got closed due to inactivity, and applying the following changes: * Resolving merge conflicts (obviously) * Linked to to_ipv4_mapped instead of to_ipv4 in the documentation (seems more appropriate) * Added the must_use and rustc_const_unstable attributes the original didn't have I think it's a reasonably useful method to have. [1] rust-lang/rust#86490
Add Ipv6Addr::is_ipv4_mapped This change consists of cherry-picking the content from the original PR[1], which got closed due to inactivity, and applying the following changes: * Resolving merge conflicts (obviously) * Linked to to_ipv4_mapped instead of to_ipv4 in the documentation (seems more appropriate) * Added the must_use and rustc_const_unstable attributes the original didn't have I think it's a reasonably useful method to have. [1] rust-lang/rust#86490
This PR adds the unstable method
Ipv6Addr::is_ipv4_mapped, as I proposed a while ago #76098 (comment). It allows for making decisions based on if an address is IPv4-mapped (see also the IPv4-in-IPv6 Address Support issue #85609). I also intend to use this method in a future rework ofIpv6Addr::is_global(edit: #86634) to more accurately follow the IANA Special Address Registry (like is done inIpv4Addr::is_global).