From fe718ef07f56457740b59b196eed0f1226137895 Mon Sep 17 00:00:00 2001 From: Corentin Henry Date: Tue, 23 Apr 2019 10:40:15 +0200 Subject: [PATCH] std::net: add warning in Ipv4addr::is_reserved() documentation See @the8472 comment's on Github: https://github.com/rust-lang/rust/pull/60145#issuecomment-485424229 > I don't think is_reserved including ranges marked for future use is > a good idea since those future uses may be realized at at some point > and then old software with is_reserved filters may have false > positives. This is not a hypothetical concern, such issues have been > encountered before when IANA assigned previously reserved /8 address > blocks. --- src/libstd/net/ip.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index e3e257f5ac177..6ea49de49af64 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -677,6 +677,13 @@ impl Ipv4Addr { /// [IETF RFC 1112]: https://tools.ietf.org/html/rfc1112 /// [`true`]: ../../std/primitive.bool.html /// + /// # Warning + /// + /// As IANA assigns new addresses, this method will be + /// updated. This may result in non-reserved addresses being + /// treated as reserved in code that relies on an outdated version + /// of this method. + /// /// # Examples /// /// ```