summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-08Merge #1292bors[bot]
1292: Support `TCP_MAXSEG` TCP Maximum Segment Size socket options r=asomers a=eaon Found myself in a situation where I needed to advertise a specific MSS. Thought this crate is the appropriate place for this feature (especially since the `TCP_MAXSEG` const was exposed through it before), so here goes. Actual change is of course tiny but it comes with a test. Happy to make changes, especially since I need to do more research on which platforms this works. Co-authored-by: eaon <eaon@posteo.net> Co-authored-by: Alan Somers <asomers@gmail.com>
2021-09-07Merge branch 'master' into socket-mssAlan Somers
2021-09-07Merge #1516bors[bot]
1516: Implement AsRawFd for PollFd r=asomers a=cemeyer Implement the trait on PollFd, providing an `as_raw_fd()` accessor to get the RawFd associated with the PollFd. Subsumes #1147, #1286. Closes #1146. Test: `cargo test --test test test_pollfd_fd` Co-authored-by: Conrad Meyer <cem@FreeBSD.org>
2021-09-07Merge #1317bors[bot]
1317: test_af_alg_aead waits indefinitely r=asomers a=ritzk Starting with linux kernel 4.9, the crypto interface changed slightly such that the authentication tag memory is only needed in the output buffer for encryption and in the input buffer for decryption. Thus, we have fewer bytes to read than the buffer size. Do not block on read. alternatively, we can adjust the decrypted buffer size based on kernel version ( ">= 4.9") to not include auth_size . ``` if kernel_version >= "4.9": let mut decrypted = vec![0u8; payload_len + (assoc_size as usize) ]; ``` before ``` test sys::test_socket::test_af_alg_aead ... test sys::test_socket::test_af_alg_aead has been running for over 60 seconds ``` after ``` test sys::test_socket::test_af_alg_aead ... ok ``` Co-authored-by: Ritesh Khadgaray <khadgaray@gmail.com>
2021-09-07Implement AsRawFd for PollFdConrad Meyer
Implement the trait on PollFd, providing an `as_raw_fd()` accessor to get the RawFd associated with the PollFd. Subsumes #1147, #1286. Closes #1146. Test: `cargo test --test test test_pollfd_fd`
2021-09-07Merge #1514bors[bot]
1514: Add support for IP_RECVERR r=asomers a=cemeyer This pull request adds support for setting the `IP_RECVERR` (and corresponding `IPV6_RECVERR`) sockopt, and then decoding the resulting control messages from `recvmsg()`. It is a Linux-specific API. This PR extends #1161 by: * Making the address associated with a `IpvXRecvErr` control message optional (`recvmsg` documentation claims it is not provided for some kinds of error), per `@WGH-.` * Adding basic tests for both IPv4 and IPv6 (blat a UDP packet at a hopefully-unoccupied port on localhost and observe ICMP port unreachable). * Adding a Changelog entry. I added some trivial doc comments on the `ControlMessageOwned` variants, but I'm not sure exactly what documentation you had in mind earlier on #1161. Co-authored-by: Conrad Meyer <cem@FreeBSD.org>
2021-09-06Add support for IP_RECVERR and IPV6_RECVERRConrad Meyer
Setting these options enables receiving errors, such as ICMP errors from the network, via `recvmsg()` with `MSG_ERRQUEUE`. Adds new `Ipv{4,6}RecvErr` variants to `ControlMessageOwned`. These control messages are produced when `Ipv4RecvErr` or `Ipv6RecvErr` options are enabled on a raw or datagram socket. New tests for the functionality can be run with `cargo test --test test test_recverr`. This commit builds on an earlier draft of the functionality authored by Matthew McPherrin <git@mcpherrin.ca>.
2021-09-04Merge branch 'master' into socket-msseaon
2021-09-04Support for `TCP_MAXSEG` TCP MSS socket optioneaon
2021-09-04Merge #1513bors[bot]
1513: Check Dragonfly BSD and OpenBSD in CI r=asomers a=asomers Build, but don't test, for these operating systems. Thanks to `@rtzoeller` for the tip. Also, fix the OpenBSD build. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-09-04Check Dragonfly BSD and OpenBSD in CIAlan Somers
Build, but don't test, for these operating systems. Thanks to @rtzoeller for the tip. Also, fix the OpenBSD build.
2021-09-04Merge #1512bors[bot]
1512: DRY in the CI config r=asomers a=asomers * Define the build and test scripts once instead of repeating them * Don't use cross with OSX. We no longer need it. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-09-04DRY in the CI configAlan Somers
* Define the build and test scripts once instead of repeating them * Don't use cross with OSX. We no longer need it.
2021-09-04Merge #1511bors[bot]
1511: Document more things r=asomers a=asomers Also, test rustdoc in CI, and demote missing_docs from a deny to a warning (but still deny it in CI). Co-authored-by: Alan Somers <asomers@gmail.com>
2021-09-04Fix some broken internal doc links in the socket codeAlan Somers
2021-09-04Enable pwritev and preadv for more operating systems.Alan Somers
2021-09-04Remove SigevNotify on OpenBSD and RedoxAlan Somers
Because nothing uses it on those OSes.
2021-09-04Document more thingsAlan Somers
Also, test rustdoc in CI, and demote missing_docs from a deny to a warning (but still deny it in CI).
2021-08-28Merge #1507 #1508bors[bot]
1507: Forbid dead code again r=asomers a=asomers The old problems with bitflags no longer apply 1508: More rust docs r=asomers a=asomers Switch from allow(missing_docs) to deny(missing_docs), which should gradually help us moving forward. Also, add a few missing docs, such as for sched and aio. Co-authored-by: Alan Somers <asomers@gmail.com>
2021-08-28More rust docsAlan Somers
Switch from allow(missing_docs) to deny(missing_docs), which should gradually help us moving forward. Also, add a few missing docs, such as for sched and aio.
2021-08-28Merge #1506bors[bot]
1506: Test Linux aarch64 on real aarch64 hardware. r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2021-08-27Ignore vsock tests on Linux aarch64Alan Somers
Apparently AWS Graviton containers don't support it. socket() retunrs EAFNOSUPPORT in that environment. Also, be more selective about skipping tests under QEMU Instead of skipping them on architectures where we happen to use QEMU, only skip them when QEMU is actually being used.
2021-08-27Test Linux aarch64 on real aarch64 hardware.Alan Somers
2021-08-28Merge #1499bors[bot]
1499: Print function name and missing capability when skipping tests r=asomers a=rtzoeller Currently when a test is skipped due to missing capabilities, a nondescript message is logged to stderr. Improve that message to include both the function name and missing capability, making it possible to inspect stderr to see which capabilities are missing, and which tests they impact. Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2021-08-27Merge #1503bors[bot]
1503: Add TcpRepair to sockopt r=asomers a=tazz4843 This PR adds the `TCP_REPAIR` flag to `nix::sys::socket::sockopt` under the name `TcpRepair`. Co-authored-by: 0/0 <zero@imaskeleton.me>
2021-08-27Merge #1501 #1505bors[bot]
1501: Mark x86_64-unknown-illumos as Tier 2 r=asomers a=rtzoeller Illumos support is automatically built, but the README does not reflect this. 1505: Fix build for DragonFlyBSD r=asomers a=rtzoeller The build for DragonFlyBSD is currently failing, due to a missing field when initializing `passwd`. Fix warnings due to types being referenced which are marked as deprecated in libc. These constants are unused by DragonFlyBSD and can be removed: https://github.com/rust-lang/libc/commit/e0d27d01051f80e1a54df2d7e73a3e2b0e1a594d Co-authored-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
2021-08-27Fix compilation warningsRyan Zoeller
2021-08-26Fix borsAlan Somers
bors got broken by a spelling change in .cirrus.yml in d20fe20af79cc6fa4528a8a170ad50a1319a1fbf that wasn't propagated to bors.toml.
2021-08-26add `TcpRepair` to sockopt0/0
2021-08-25Fix build for DragonFlyBSDRyan Zoeller
2021-08-23Mark x86_64-unknown-illumos as Tier 2Ryan Zoeller
2021-08-22Print function name and missing capability when skipping testsRyan Zoeller
2021-08-22Merge pull request #1497 from asomers/cirrus2Alan Somers
Multiple CI improvements
2021-08-22Multiple CI improvements:Alan Somers
* Install cross the easy way, via cargo * Don't test in release mode. Nix contains no release-dependent paths, and release mode testing has to my knowledge never revealed a bug in Nix. * Add Linux powerpc back to CI, fixed by the latest cross. * Check the tests even on platforms that can't run them. * DRY for the Illumos and Redox sections * Cross-check iOS from a Linux VM instead of OSX * Revert the workaround for rust-lang/rustup issue 2774
2021-08-22Fix building the tests for Redox and IllumosAlan Somers
Also, split the overbroad test_mknod_family into two tests
2021-08-22Merge #1447bors[bot]
1447: Expose SockAddr::from_raw_sockaddr r=asomers a=coolreader18 I also noticed the `SockAddr/InetAddr::to_str` functions were entirely redundant - `ToString` exists for that, & has a blanket impl on `T: Display`. Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-08-21Merge #1495bors[bot]
1495: Deprecate SockAddr/InetAddr::to_str r=asomers a=coolreader18 Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
2021-08-21Expose SockAddr::from_raw_sockaddrNoah
2021-08-21Deprecate SockAddr/InetAddr::to_strNoah
2021-08-21Merge #1335bors[bot]
1335: Add `PTRACE_EVENT_STOP` enum variant r=asomers a=GabrielMajeri Adds the `PTRACE_EVENT_STOP` variant to the `ptrace::Event` enum. Smaller part of #1279 Closes #1334 Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2021-08-18Add a changelog entryGabriel Majeri
2021-08-18Add `PTRACE_EVENT_STOP` enum variantGabriel Majeri
2021-08-18Merge #1486 #1490 #1493bors[bot]
1486: Relax assertions in sockaddr_storage_to_addr to match the documentation. r=asomers a=khuey Fixes #1479 1490: add libc::IP6T_SO_ORIGINAL_DST to socket opt r=asomers a=bearice the original PR #1410 was stalled for a while let's make it happen. this should closes #1410 and #938 1493: Fix crates.io badge r=asomers a=atouchet Co-authored-by: Kyle Huey <khuey@kylehuey.com> Co-authored-by: Icemic <bingfeng.web@gmail.com> Co-authored-by: Bearice Ren <bearice@icybear.net> Co-authored-by: Alex Touchet <alextouchet@outlook.com>
2021-08-18Merge #1489bors[bot]
1489: Don't use mem::transmute in SignalFd r=asomers a=asomers There was a better case for using it before mem::uninitialized was available, but not great. Even before then, mem::zeroed could've been used instead. Issue #373 Co-authored-by: Alan Somers <asomers@gmail.com>
2021-08-18[skip ci] Fix bors configurationAlan Somers
* I never removed 32-bit OSX and iOS targets that were removed from Cirrus in PR #1492 . * I never added Fuchsia (PR #1285) . * I never added illumos (PR #1394) . * never added Linux x32 (PR #1366) .
2021-08-17Relax assertions in sockaddr_storage_to_addr to match the documentation.Kyle Huey
Fixes #1479
2021-08-17Don't use mem::transmute in SignalFdAlan Somers
There was a better case for using it before mem::uninitialized was available, but not great. Even before then, mem::zeroed could've been used instead. Issue #373
2021-08-17Simplify definition of SIGNALFD_SIGINFO_SIZEAlan Somers
mem::size_of has been a const fn since Rust 1.24.0. Use it.
2021-08-13Fix crates.io badgeAlex Touchet
2021-08-13Merge pull request #1492 from asomers/bitflags_1.3.1Alan Somers
Fix the build with bitflags-1.3.0 and newer