Skip to content

Commit fe718ef

Browse files
committed
std::net: add warning in Ipv4addr::is_reserved() documentation
See @the8472 comment's on Github: #60145 (comment) > 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.
1 parent 634dcd0 commit fe718ef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libstd/net/ip.rs

+7
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,13 @@ impl Ipv4Addr {
677677
/// [IETF RFC 1112]: https://tools.ietf.org/html/rfc1112
678678
/// [`true`]: ../../std/primitive.bool.html
679679
///
680+
/// # Warning
681+
///
682+
/// As IANA assigns new addresses, this method will be
683+
/// updated. This may result in non-reserved addresses being
684+
/// treated as reserved in code that relies on an outdated version
685+
/// of this method.
686+
///
680687
/// # Examples
681688
///
682689
/// ```

0 commit comments

Comments
 (0)