Skip to content

Commit 2afa01f

Browse files
committed
bug -> feature
Signed-off-by: John Nunley <[email protected]>
1 parent 781e3c8 commit 2afa01f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/os/unix/net/addr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ impl SocketAddr {
112112
// linux returns zero bytes of address
113113
len = sun_path_offset(&addr) as libc::socklen_t; // i.e., zero-length address
114114
} else if cfg!(target_os = "openbsd") {
115-
// OpenBSD has a bug where the socket name's length
116-
// is more than what the buffer actually contains.
117-
// Figure out the length for ourselves.
115+
// OpenBSD implements getsockname in a way where the
116+
// socket name's length is more than what the buffer
117+
// actually contains. Figure out the length for ourselves.
118118
// https://marc.info/?l=openbsd-bugs&m=170105481926736&w=2
119119
let sun_path: &[u8] = unsafe { crate::mem::transmute::<&[i8], &[u8]>(&addr.sun_path) };
120120
len = crate::sys::memchr::memchr(0, sun_path)

0 commit comments

Comments
 (0)