Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for Ipv{4,6}Addr convenience methods #27709
Comments
alexcrichton
added
A-io
T-libs
B-unstable
labels
Aug 12, 2015
This comment has been minimized.
This comment has been minimized.
|
I think we should consider this for stabilization in 1.6. Nominating. |
aturon
added
the
I-nominated
label
Nov 3, 2015
This comment has been minimized.
This comment has been minimized.
|
Concretely, we discussed this in the libs meeting and the conclusion was that the boolean accessors are likely ready for stabilization after verifying that they're all the canonical definitions, but the |
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Nov 5, 2015
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Nov 5, 2015
|
What, exactly, is the "ip feature"? Could you link to the RustDoc(s) of the specific things that are supposed to be reviewed? |
This comment has been minimized.
This comment has been minimized.
|
I think "ip feature" in this context refers to things annotated with |
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Nov 6, 2015
I don't mean to be rude, but that's just a restating my question as the answer. if you want people to actually give feedback on the proposal, it should be easier to understand what the proposal is. In this case, it is pretty difficult to tell what is being proposed because the module mixes stable and unstable features. I noticed that a large part of this module could work in It also seems odd that |
This comment has been minimized.
This comment has been minimized.
|
@briansmith I don't think that's being rude, there's just tension here between "we've been doing this a while so we're a bit short" and "newer people might not know what that is." @SimonSapin leaned a bit towards a literal explanation, but you're right to point out that more detail is good. I read @alexcrichton 's comment as:
http://doc.rust-lang.org/std/net/struct.Ipv4Addr.html and http://doc.rust-lang.org/std/net/struct.Ipv6Addr.html <- all the stuff here that is
http://doc.rust-lang.org/std/net/struct.Ipv6Addr.html#method.multicast_scope is the only one I see that's unstable. |
This comment has been minimized.
This comment has been minimized.
|
FWIW, I filed #29221 a while ago, which would make tracking down what these tracking issues refer to slightly easier. |
This comment has been minimized.
This comment has been minimized.
|
Yes, to be concrete, I was proposing stabilizing:
Note that this is all pending actually verifying that these are standard properties of the respective IP address space and are well known with canonical implementations. I believe they fit this requirement already but would like to double-check.
Yeah these things can certainly move around over time (it's backwards compatible to move them at a later date). I'd be a little wary of putting things in core "just because" without a concrete purpose, and these kinda fall into the category I'd be wary of. For example the internal representation of each of these primitives is the
Method resolution favors inherent methods (methods defined on the type itself) over trait methods (e.g. impl'd traits plus the trait being in scope), so in that sense we're covered to add a trait at a future date. That being said the standard library doesn't have too many traits like this for abstracting between one or two types, so I would personally want to hold off on this extension for now. A possible alternative, however, could be adding the common set of methods to |
This comment has been minimized.
This comment has been minimized.
|
A couple of issues I have noticed with what we have:
On a more general note, might some of these functions need to be updated in the future if new ranges are assigned? How would that be handled? |
This comment has been minimized.
This comment has been minimized.
|
Ah I unfortunately did not have time to do an audit of these APIs this cycle, so when the libs team talked about this during triage today the conclusion was to punt this to next cycle, I hope to have the time to investigate it then and incorportate @ollie27's suggestions! |
alexcrichton
added
the
I-nominated
label
Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Hopefully I get a chance to researching this API this time around! |
alexcrichton
removed
the
I-nominated
label
Dec 17, 2015
This comment has been minimized.
This comment has been minimized.
|
Better late than never! -- my analysis: Of the ipv4 properties, there's more listed on wikipedia at least, for example:
These sound relatively obscure (at least to me) though, so it seems fine that we don't add them just yet. In terms of what we currently have:
Like with ipv4 we're missing some ipv6 properties (according to RFC 6890):
Of the ipv6 methods:
From this I'm comfortable stabilizing the checked methods (they've got verified names and implementations at least), but I would personally want some more verification of the unchecked methods before stabilizing. |
This comment has been minimized.
This comment has been minimized.
vinipsmaker
commented
Jan 13, 2016
Sounds like a good start. The |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this during triage yesterday and the decision was to stabilize the methods I've checked above |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 15, 2016
alexcrichton
referenced this issue
Jan 15, 2016
Merged
std: Stabilize APIs for the 1.7 release #30943
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 15, 2016
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 15, 2016
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 16, 2016
bors
added a commit
that referenced
this issue
Jan 16, 2016
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 16, 2016
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 16, 2016
This comment has been minimized.
This comment has been minimized.
|
Also, I think it would be worth having |
This comment has been minimized.
This comment has been minimized.
I'd like to work on that. I'll try to send a first PR tonight. |
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Jun 26, 2018
therealbstern
pushed a commit
to therealbstern/rust
that referenced
this issue
Jun 26, 2018
This comment has been minimized.
This comment has been minimized.
|
@little-dude, The errata for RFC 4291, and more specifically erratum 4406 make this much less clear than one might think. /10 is reserved for link-local and similar uses, though only /64 is defined right now, and they don't name what the rest of it for. RFC 7371 also takes the opportunity to mention that the link-local /10 exists and then appears to discuss multicast without regard to whether or not it's a new chunk of the /10 or not. Anyway, the point is, although I agreed with your suggestion so much that I initially thought I had written it, I'm no longer so sure how to stand on this. |
This comment has been minimized.
This comment has been minimized.
|
I see, it's debatable indeed. To sum up:
I have slight preference for validating the second range since that as of today, the only valid unicast link local addresses are in Otherwise, why not having two methods with a detailed documentation of how they differ: |
This comment has been minimized.
This comment has been minimized.
|
@therealbstern I've started working on fixing |
This comment has been minimized.
This comment has been minimized.
|
Obviously, I'm not in charge of the API here, but I personally think your validation plan is the way to fly. Also, the looser method would help more with the "is this globally routable" question. Did you understand what RFC 7371 was saying? I thought it meant that some of the /10 link-local space was going to become multicast, but I might have completely misunderstood. :-P |
little-dude
referenced this issue
Jun 27, 2018
Closed
std::net: Ipv4Addr and Ipv6Addr improvements #51832
This comment has been minimized.
This comment has been minimized.
|
Why is this still unstable? |
This comment has been minimized.
This comment has been minimized.
|
This PR has not been finished. You can pick it up if you want, or I can try finishing it but I won't be able to this week. |
This comment has been minimized.
This comment has been minimized.
|
No, take your time. :) I'm terribly sorry for pressing hard, I just wondered, by no means did I want to attack you and your work. I do not know a lot about the RFC process here and marking things as stable. My laptop is too weak to test out the changes. |
This comment has been minimized.
This comment has been minimized.
|
Hey, how do I stabilize these methods? What is the procedure? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Or I'll try to finish it off this weekend if you don't. I'm a bit disappointed that I did not push it to the finish line. |
This comment has been minimized.
This comment has been minimized.
|
I won't =) Push it to the finish line! |
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 17, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 17, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 18, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 18, 2018
little-dude
referenced this issue
Nov 18, 2018
Closed
std::net: Ipv4Addr and Ipv6Addr improvements #56050
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 18, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 18, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 18, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 18, 2018
little-dude
added a commit
to little-dude/rust
that referenced
this issue
Nov 19, 2018
This comment has been minimized.
This comment has been minimized.
|
FYI, a bug was just filed related to |
frewsxcv
referenced this issue
Jan 13, 2019
Open
Ipv4Addr::is_global() returns true for non global address #57558
This comment has been minimized.
This comment has been minimized.
|
As above, this has been a problem for a while and is not a regression. I did not fix it because it looked like trying to figure how to name the reason that an IPv4 address might not be global looked like a maze of twisty little passages all alike. If naming the various blocks or otherwise identifying them in the API is not significant, then I can pick this up and fix it for IPv4. |
This comment has been minimized.
This comment has been minimized.
|
@little-dude please finish #56050 |
alexcrichton commentedAug 12, 2015
•
edited by Mark-Simulacrum
The below is a list of methods left to be stabilized under the
ipfeature. The path forward today is unclear; if you'd like to push through any method on here the libs team is interested in a PR with links to the associated RFCs or other official documentation. Let us know!Ip::is_documentationIpv6::is_documentationIp::is_globalIpv4::is_globalIpv6::is_globalIpv6::is_unicast_globalIpv6::is_unicast_link_localIpv6::is_unicast_site_localIpv6::is_unique_localIpv6::multicast_scope