]> git.lizzy.rs Git - rust.git/commit
Change everything returning `libc::sockaddr_storage` to use an &mut out-ptr instead
authorAndrew Poelstra <apoelstra@wpsoftware.net>
Mon, 4 Aug 2014 16:46:15 +0000 (09:46 -0700)
committerAndrew Poelstra <apoelstra@wpsoftware.net>
Mon, 4 Aug 2014 19:52:58 +0000 (12:52 -0700)
commit30452d4cda331610418d4dc01023f2d1cdc1ee43
treefecc3bedaa0363e5facb0bccee82ebc8ed34585d
parentefe1f7ee9efb5da5613f2cff4f9b810d2d5992d4
Change everything returning `libc::sockaddr_storage` to use an &mut out-ptr instead

The BSD socket code does some cast tricks with the `libc::sockaddr*`
structs, which causes useful data to be stored in struct padding.
Since Load/Store instructions do not copy struct padding, this makes
these structures dangerous to pass or return by value.

In particular, https://github.com/rust-lang/rust/issues/15763 changes
return semantics so that a Load instruction is used, breaking the TCP
code. Once this PR is merged, that one should merge without error.
src/libnative/io/net.rs
src/libnative/io/pipe_unix.rs
src/librustuv/net.rs