use IPV6 loopback and documentation address in documentation over V4 by default - #161879
use IPV6 loopback and documentation address in documentation over V4 by default#1618792ndDerivative wants to merge 18 commits into
Conversation
…v6 multicast_loop methods
My submission towards rust-lang#161832 I didn't touch any tests or anything that actually gets run for now, but if this is realistic Rust should probably default to using [::1] loopback for the std tests too.
|
Thanks for the pull request, and welcome! The Rust Project has assigned @joboet (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
|
This comment has been minimized.
This comment has been minimized.
|
I really don't have an opinion here, networking isn't my domain (pun intended). @rustbot reroll |
|
I admit I'm struggling to feel strongly about this either way. This does feel like a policy decision though:
@rust-lang/libs does anybody have thoughts on this? |
|
I can take this over since I did the previous one. r? clarfonthey |
This comment has been minimized.
This comment has been minimized.
Personally I'm -0.75 – users are way more likely to encounter IPv4 at the time being, and likely for the foreseeable future. I don't think I've ever seen documentation anywhere use |
|
This is definitely a spicy take, but I feel compelled to remind people that IPv6 is almost 30 years old and the fact that we still use IPv4 at all is a travesty and something the entire tech industry should be ashamed of. (Yes, IPv6 was standardised in 1998. It's that old.) I agree that we should still support IPv4 and make sure that our APIs can handle it, but I think that if people are confused to see IPv6 addresses on APIs that very explicitly accept them that is something they should quickly rectify. And, it's especially helpful that the two most commonly written IPv6 addresses, I will probably ask around the libs team to make sure I'm not being too spicy here but most of the arguments I've seen complaining about IPv6 (here and elsewhere) are mostly just people misunderstanding how IPv6 works or being resistant to change, neither of which feels particularly compelling here. |
Disagreed, in a typical keyboard to enter an IPv6 address you need to reach for Shift and requires simultaneous touch. To type In any case typing should not be relevant to this PR at all, this PR is about example code i.e. reading, and I'd argue:
- /// SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080)));
+ /// SocketAddr::V6(SocketAddrV6::new(
+ /// Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1),
+ /// 8080,
+ /// 0,
+ /// 0
+ /// )));
While I'd love to see IPv6 supported everywhere (CGNAT is awful), in the context of this PR I don't see replacing examples using 127.0.0.1 with ::1 alone produced any benefits (this is unlike |
If readability is your problem, we can always replace this kind of usage with the LOCALHOST and UNSPECIFIED constants |
|
…al value is low-priority
…is covered by the constant
It is explicitly not a grander T-libs policy which is why I've been asking for more explicit feedback on it. While I think this is a better change, I am also someone who kind of wants to bend over backwards to get people more used to IPv6, which is far from a neutral position. And it's also especially worthwhile to call out ergonomics here, which are fixable but require broader changes. |
|
Okay, so, a day later, dismounting my horse, I actually thought the original issue had way more support than it actually did, and also 100% agree that while for APIs like I think it would be reasonable to stop and say that we probably should not explicitly just replace 127.0.0.1 with ::1 here, but I think anywhere where we add both IPv4 and IPv6 examples is fine. I'll point them out as examples in review comments. Edit: there actually aren't examples of this happening, since I failed tech 101 and that diffs include the before and after because I was excited about IPv6. But alternating between examples might be okay. Would need to generate docs after to compare, but, maybe that's reasonable to have a broader variety of addresses. |
View all comments
This defaults all documentation unrelated to specific IP versions to the current IPv6.
Related to issue #161832
I didn't touch any tests, as I'm pretty new and don't know much about the test infrastructure, but maybe it should be considered to run all the tests via the v6 loopback by default too.
Feel free to discuss and / or critique!