Skip to content

Add Ipv6Addr::to_ipv4_mapped#75019

Merged
bors merged 1 commit intorust-lang:masterfrom
nanpuyue:to_ipv4_mapped
Aug 12, 2020
Merged

Add Ipv6Addr::to_ipv4_mapped#75019
bors merged 1 commit intorust-lang:masterfrom
nanpuyue:to_ipv4_mapped

Conversation

@nanpuyue
Copy link
Contributor

@nanpuyue nanpuyue commented Aug 1, 2020

According to IETF RFC 4291, the "IPv4-Compatible IPv6 address" is deprecated.

2.5.5.1. IPv4-Compatible IPv6 Address

The "IPv4-Compatible IPv6 address" was defined to assist in the IPv6
transition. The format of the "IPv4-Compatible IPv6 address" is as
follows:

| 80 bits | 16 | 32 bits |
+--------------------------------------+--------------------------+
|0000..............................0000|0000| IPv4 address |
+--------------------------------------+----+---------------------+

Note: The IPv4 address used in the "IPv4-Compatible IPv6 address"
must be a globally-unique IPv4 unicast address.

The "IPv4-Compatible IPv6 address" is now deprecated because the
current IPv6 transition mechanisms no longer use these addresses.
New or updated implementations are not required to support this
address type.

And the current implementation of Ipv4Addr::to_ipv6_compatibleis incorrect: it does not check whether the IPv4 address is a globally-unique IPv4 unicast address.

Please let me know if there are any issues with this pull request.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants