Skip to content

Commit 4bbb1c5

Browse files
authored
Auto merge of #34739 - therealbstern:ipv4unspec, r=alexcrichton
Mark Ipv4Addr is_unspecified as stable and provide reference. Per [#27709 (comment)](#27709 (comment)), no RFC is needed here. IPv4 "unspecified" has been defined in [Stevens], and has been part of the IPv4 stack for quite some time. This property should become stable, since this use of 0.0.0.0 is not going anywhere. [Stevens][_UNIX Network Programming Volume 1, Second Edition_. Stevens, W. Richard. Prentice-Hall, 1998. p. 891] Please let me know if I got the rustdoc wrong or something. I tried to be as terse as possible while still conveying the appropriate information. This also has a slight impact on PR #34694, but that one came first, so this shouldn't block it, IMO.
2 parents 26fd011 + cd487db commit 4bbb1c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libstd/net/ip.rs

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ impl Ipv4Addr {
8383
}
8484

8585
/// Returns true for the special 'unspecified' address (0.0.0.0).
86+
///
87+
/// This property is defined in _UNIX Network Programming, Second Edition_,
88+
/// W. Richard Stevens, p. 891; see also [ip7]
89+
/// [ip7][http://man7.org/linux/man-pages/man7/ip.7.html]
8690
pub fn is_unspecified(&self) -> bool {
8791
self.inner.s_addr == 0
8892
}

0 commit comments

Comments
 (0)