about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-03-30 00:32:21 +0200
committerGitHub <noreply@github.com>2021-03-30 00:32:21 +0200
commit772582e19ef366e4be686bfcfd65667dc033fe3a (patch)
tree0a485e095e1e3e5adc5285392055d2ae13fe6063 /src/test
parent68964d1fc24888b04be492c3f3ba0dae7d6219da (diff)
parent3d6bd87b24a2fbccb6c1e81863874789eb046c17 (diff)
downloadrust-772582e19ef366e4be686bfcfd65667dc033fe3a.tar.gz
rust-772582e19ef366e4be686bfcfd65667dc033fe3a.zip
Rollup merge of #83374 - reyk:fix/bsd-ancillary, r=joshtriplett
unix: Fix feature(unix_socket_ancillary_data) on macos and other BSDs

This adds support for CMSG handling on macOS and fixes it on OpenBSD and possibly other BSDs.

When traversing the CMSG list, the previous code had an exception for Android where the next element after the last pointer could point to the first pointer instead of NULL.  This is actually not specific to Android: the `libc::CMSG_NXTHDR` implementation for Linux and emscripten have a special case to return NULL when the length of the previous element is zero; most other implementations simply return the previous element plus a zero offset in this case.

This MR makes the check non-optional which fixes CMSG handling and a possible endless loop on such systems; tested with file descriptor passing on OpenBSD, Linux, and macOS.

This MR additionally adds `SocketAncillary::is_empty` because clippy is right that it should be added.

This belongs to the `feature(unix_socket_ancillary_data)` tracking issue:  https://github.com/rust-lang/rust/issues/76915

r? `@joshtriplett`
Diffstat (limited to 'src/test')
0 files changed, 0 insertions, 0 deletions