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

Stabilize the "IP" feature (continued from #76098) #85585

Closed
wants to merge 24 commits into from

Conversation

saethlin
Copy link
Member

I noticed the work in #76098 seemed abandoned, so I'm reviving it here. I'm not particularly familiar with RFC 4291 but I'm no stranger to reading IETF RFCs.

I'm not totally clear on what still needs to be done. There's a fair bit of discussion in the preceding PR, but some if it seems outdated. Over the next few days I'll try to piece together what still needs to be done, but if anyone (@KodrAus, @CDirkx, @jyn514) knows better than I please point me in the right direction.

little-dude and others added 24 commits May 22, 2021 12:26
Feature tracking issue: rust-lang#27709

- Stabilize the following methods:
    - `IpAddr::is_global`
    - `IpAddr::is_documentation`
    - `Ipv4Addr::is_global`
    - `Ipv4addr::is_shared`
    - `Ipv4Addr::is_ietf_protocol_assignment`
    - `Ipv4addr::is_benchmarking`
    - `Ipv4Addr::is_reserved`
    - `Ipv6Addr::is_global`
    - `Ipv6Addr::is_unique_local`
    - `Ipv6Addr::is_unicast_link_local_strict`
    - `Ipv6Addr::is_unicast_link_local`
    - `Ipv6Addr::is_unicast_site_local`
    - `Ipv6Addr::is_documentation`
    - `Ipv6Addr::is_unicast_global`
    - `Ipv6Addr::multicast_scope`
- Stabilize the following enum: `Ipv6MulticastScope`
- Document IP helpers stability guarantees (fixes rust-lang#60239)
Add variants for the currently reserved and un-assigned scopes. Since
variants may be added in the future as new RFCs get published, we also
make this enum #[non_exhaustive].

Ref: rust-lang#66584 (comment)
Thanks again for the help with understanding the attributes!

Co-authored-by: Ashley Mannix <kodraus@hey.com>
Remove the looser `is_unicast_link_local` and
rename `is_unicast_link_local_strict` as i suggested 😊

See rust-lang#76098 (comment)
Getting kind of extremely out of my comfort zone here and modifying quite a few different files...i hope this is all ok...
I really...i'm terrified i'm breaking something here
Because of the changes made due to the discussion [here](rust-lang#76098 (comment)),
the checks for the more relaxed behavior of the old
`is_unicast_link_local` method failed when they were tuned to the new,
stricter checking behavior. These test cases have been modified to
check that a given IPv6 address *is not* unicast link local, using
a bitwise or'ing strategy that was already present in other test cases.

Further discussion [here](https://rust-lang.zulipchat.com/#narrow/stream/212497-t-compiler.2Fhelp-wanted/topic/fix.20tests.20for.20.2376098).
This brings the behavior more in line with Go, Python, Linux, and C.

I know, this should have been a `git revert` but honestly I don't trust
myself with that and I just had a big mishap trying to merge upstream
Rust anyway so forgive me :crying:
This reverts commit e0f66e43da61d8fe8aadc6bcdc2545de51607332.
Per [RFC 4291](https://tools.ietf.org/html/rfc4291#section-2.5.5.1),
IPv6-Compatible IPv4 Addresses are deprecated and may be ignored,
so let's ignore them! Also add some tests indicating that IPv6-Mapped
addresses are treated specially, but IPv6-Compatible addresses are not.
…ses"

This reverts commit 63329f9eadbba6da75a04cbf613f5701b06f71e5.

Also, change the behavior of `to_ipv4` to ignore Ipv4-compatible addresses
instead of adding another method `to_ipv4_mapped` and never ever using
`to_ipv4` instead. Since this method is in stable.
- Use new intra-doc linking
- Clarify that the RFC's are IETF RFC's
just did a really big rebase and i'm slightly concerned
that i somehow tanked this whole branch but i guess we'll see
* Move libstd ip tests to their own module
* Delete failing test; mapped addresses are never unspecified
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 22, 2021
@jyn514
Copy link
Member

jyn514 commented May 22, 2021

@saethlin this is the latest update I know of: #76098 (comment). I don't know the status other than that.

@CDirkx
Copy link
Contributor

CDirkx commented May 23, 2021

I think the best way forward for this PR is to split it up into several smaller pieces:

Edit: updated to reflect the current state of things

@CDirkx
Copy link
Contributor

CDirkx commented May 23, 2021

I split everything up into several issues:

@CDirkx
Copy link
Contributor

CDirkx commented May 23, 2021

Directly actionable for anyone right now:

I think anything else will require addressing the open problems listed in the issues I opened, which will require gathering evidence for the best approach and reaching a consensus. So I don't see stabilization of the entire ip feature possible in the near future. I think it would be better to instead break it up into smaller features like ipv6_unicast, ip_global etc. to enable stabilization piece by piece.

@Mark-Simulacrum
Copy link
Member

r? @joshtriplett as T-libs member, not sure what the state here is but I likely don't have the expertise on various IP stuff to say anyway.

@bors
Copy link
Contributor

bors commented May 26, 2021

☔ The latest upstream changes (presumably #85711) made this pull request unmergeable. Please resolve the merge conflicts.

@crlf0710
Copy link
Member

@saethlin Ping from triage! There's merge conflict now. Would you mind rebasing this pr?

@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2021
@saethlin
Copy link
Member Author

saethlin commented Jul 2, 2021

@crlf0710 I appreciate the attention. I'll get to this soon.

@JohnTitor JohnTitor added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 13, 2021
@JohnTitor
Copy link
Member

Triage: Marking as S-blocked as we're splitting this PR into smaller ones and triaging is unnecessary until it's done.

@the8472 the8472 added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 8, 2021
@saethlin
Copy link
Member Author

Closing this because I have precious little expertise to offer here. It looks like there are much more capable contributors about, and I have other priorities.

@saethlin saethlin closed this Feb 22, 2022
@saethlin saethlin deleted the stabilize-ip branch May 16, 2022 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. 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.