Commit Graph

2937 Commits

Author SHA1 Message Date
Alan Somers
6fb3a8fcaa
Merge pull request #2094 from asomers/clippy-aug-11-2023
Clippy cleanup: noop_method_call
2023-08-11 15:43:32 +00:00
Alan Somers
18cbec28a8 Clippy cleanup: noop_method_call 2023-08-11 09:24:01 -06:00
Alan Somers
ee914235cc
Merge pull request #1915 from asomers/sockopt-iosafety
Add I/O safety to sockopt and some socket functions
2023-08-07 02:38:44 +00:00
Alan Somers
783e38d760
Merge pull request #2082 from inferiorhumanorgans/solaris-no-flock
Don't build flock on Solaris
2023-08-07 02:38:35 +00:00
Alan Somers
1052977b0c
Merge pull request #2089 from asomers/no-bors
Retire Bors
2023-08-07 02:38:26 +00:00
Alan Somers
c1317e477f Add I/O safety to sockopt and some socket functions
* socket
* socketpair
* listen
* setsockopt
* getsockopt
2023-08-06 20:18:09 -06:00
Alan Somers
950bd09df4 Retire Bors
Bors worked well for a long time.  But that product is now retiring.
It's been replaced by GitHub's built-in merge queues.

Fixes #2078
2023-08-06 18:28:59 -06:00
Alex Zepeda
5e7bfd5970 fcntl: Solaris doesn't have flock(2)
Solaris hasn't included flock(2) for a long while now, and building
this wrapper creates issues with undefined symbols.  However,
OpenSolaris derivatives like Illumos do include flock(2) so they should
not be excluded here.
2023-08-06 16:44:51 -07:00
bors[bot]
ea149819d8
Merge #2019 #2087
2019: Fix aio_suspend in non-trivial cases r=asomers a=asomers

aio_suspend would probably fail with EFAULT if the first operation in the list wasn't complete, due to an invalid pointer cast.

Also, deprecate lio_listio, which has the same problem, and others besides.

Fixes #1980

2087: Fix Haiku build by updating tempfile to 3.7.1 r=asomers a=asomers

https://github.com/Stebalien/tempfile/issues/246

Co-authored-by: Alan Somers <asomers@gmail.com>
2023-08-06 23:36:41 +00:00
bors[bot]
f9d3a224e2
Merge #2088
2088: sockopt add OpenBSD's SO_RTABLE to set the route table. r=asomers a=devnexen

Also SO_ACCEPTFILTER for FreeBSD/NetBSD.

Co-authored-by: David Carlier <devnexen@gmail.com>
Co-authored-by: David CARLIER <devnexen@gmail.com>
2023-08-06 23:24:32 +00:00
bors[bot]
53b033267f
Merge #1823
1823: Support AIX operating system r=asomers a=ecnelises



Co-authored-by: Qiu Chaofan <qcf@ecnelises.com>
2023-08-06 22:38:56 +00:00
David CARLIER
3591ed85c3 add CHANGELOG entry 2023-08-06 23:20:34 +01:00
David Carlier
2ab1eafbdd sockopt add OpenBSD's SO_RTABLE to set the route table.
Also SO_ACCEPTFILTER for FreeBSD/NetBSD.
2023-08-07 00:13:21 +01:00
Alan Somers
94b2c5520b Fix Haiku build by updating tempfile to 3.7.1
https://github.com/Stebalien/tempfile/issues/246
2023-08-06 16:02:14 -06:00
bors[bot]
78a4d9e247
Merge #2056
2056: add vsock support for macOS r=asomers a=tzneal

Adds vsock support for macOS.  It's not possible to create a listening
vsock socket on a macOS host, but you can create one from inside a 
VM and connect back to the host.

Co-authored-by: Todd Neal <tnealt@amazon.com>
Co-authored-by: Alan Somers <asomers@gmail.com>
2023-08-06 21:28:32 +00:00
Alan Somers
d517f071b6
Merge branch 'master' into add-vsock-support-for-macos 2023-08-06 15:27:56 -06:00
bors[bot]
779b23c2ab
Merge #2085
2085: Adding new sockopt entries for FreeBSD related to routing r=asomers a=devnexen



Co-authored-by: David CARLIER <devnexen@gmail.com>
2023-08-06 20:25:32 +00:00
David CARLIER
8e4150e8cd adding changelog entry 2023-08-06 21:15:53 +01:00
David CARLIER
5378cceff0 Adding new sockopt entries for FreeBSD related to routing 2023-08-06 21:15:51 +01:00
bors[bot]
d23b798b99
Merge #2079
2079: Remove sigevent support on Fuchsia r=asomers a=asomers

It triggers UB, which the compiler warns about beginning with 1.41.0. Remove it, due to lack of a Fuchsia maintainer and lack of feedback from the original Fuchsia porter.

Fixes #1441

Co-authored-by: Alan Somers <asomers@gmail.com>
2023-08-06 19:53:08 +00:00
bors[bot]
5680df897e
Merge #2086
2086: Clippy cleanup r=asomers a=asomers

Clippy found some const-correctness issues in internal APIs, but nothing user-facing.

Co-authored-by: Alan Somers <asomers@gmail.com>
2023-08-06 19:34:43 +00:00
Alan Somers
31162fd424 Fix the build on Haiku
By restricting tempfile to 3.6.0 or lower.

https://github.com/Stebalien/tempfile/issues/246
2023-08-06 13:01:44 -06:00
Alan Somers
59e7794f0a Clippy cleanup
Clippy found some const-correctness issues in internal APIs, but nothing
user-facing.
2023-08-06 12:42:19 -06:00
Qiu Chaofan
8345f3e694 Initial support for AIX operating system 2023-07-19 10:32:51 +08:00
Todd Neal
7a9826273f add vsock support for macOS 2023-07-18 07:31:29 -05:00
Alan Somers
625287e50d Remove sigevent support on Fuchsia
It triggers UB, which the compiler warns about beginning with 1.41.0.
Remove it, due to lack of a Fuchsia maintainer and lack of feedback from
the original Fuchsia porter.

Fixes #1441
2023-07-17 17:31:41 -06:00
bors[bot]
c375a102ac
Merge #2041
2041: Set the length of a socket address when calling `recvmsg` on Linux r=asomers a=JarredAllen

# Background
I think I've found a bug with `recvmsg` on Linux where it doesn't set the length of a received socket address. I found this while working with unix datagram sockets with path `struct sockaddr_un` addresses, but I think this applies to any variable-length socket address type.

At present, the `sun_len` field of `UnixAddr` on Linux shows up as 0 whenever I call `recvmsg`. I think it's reading uninitialized memory (afaict the `recvmsg` function never initializes it before we call `MaybeUninit::assume_init`), though it's possible that it's being zero-initialized somewhere that I missed. Either way, this isn't the correct behavior, which should set it to the length of the `struct sockaddr_un` contents (or whatever other type of socket).

# Changes
I changed the `recvmsg` function to construct the returned socket address from the `struct sockaddr` and length returned by the libc `recvmsg` call (using the `from_raw` function the trait provides). Since the trait is sealed so downstream crates can't implement it, I believe this shouldn't be a breaking change.

# Validation
I've tested that my code (which failed due to this bug) now works. I also added a new test case which tests that we construct `UnixAddr`s correctly in the `recvmsg` function, which passes locally for me and fails if I cherry-pick it onto the current `master`.

I've also checked that `cargo test` and `cargo clippy` both still pass on `aarch64-apple-darwin` and on `aarch64-unknown-linux-musl` targets (the two targets I develop for/have access to). Hopefully your CI will confirm that everything else still works.

Co-authored-by: Jarred Allen <jarred@moveparallel.com>
Co-authored-by: Jarred Allen <jarredallen73@gmail.com>
2023-07-17 22:26:39 +00:00
Jarred Allen
2d60044196 Fix lint 2023-07-17 14:57:11 -07:00
Jarred Allen
2378f12dd5
Correctly let the kernel set the length on BSDs
Co-authored-by: Alan Somers <asomers@gmail.com>
2023-07-17 14:45:43 -07:00
bors[bot]
1d61638a72
Merge #2077
2077: Enable socket timestamping options on Android r=asomers a=spencercw

Requires https://github.com/rust-lang/libc/pull/3267 which landed in libc 0.2.147.

Co-authored-by: Chris Spencer <spencercw@gmail.com>
2023-07-17 21:32:09 +00:00
Jarred Allen
23125cbb1b Merge branch 'master' into set-sockaddr-length-linux 2023-07-17 11:34:00 -07:00
Jarred Allen
012e788adc More PR feedback 2023-07-17 11:33:43 -07:00
Chris Spencer
87190dab19 Enable socket timestamping options on Android 2023-07-17 10:27:37 +01:00
bors[bot]
c3e6e6a142
Merge #2048
2048: Enable additional socket timestamping flags r=asomers a=spencercw



Co-authored-by: Chris Spencer <spencercw@gmail.com>
2023-07-15 20:50:11 +00:00
bors[bot]
b12aeb723c
Merge #2076
2076: Clippy cleanup r=asomers a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
2023-07-15 18:45:19 +00:00
Alan Somers
4589411229 Clippy cleanup 2023-07-15 11:52:09 -06:00
bors[bot]
75a26cd1e0
Merge #2067
2067: Address seeming typo in lib.rs r=asomers a=solidsnack

I believe the `my` here was intended to be `many` -- but am not sure.

Co-authored-by: Jason Dusek <jason.dusek@gmail.com>
2023-07-02 20:45:03 +00:00
Jason Dusek
5b2e4af76e
Address seeming typo in lib.rs
I believe the `my` here was intended to be `many` -- but am not sure.
2023-07-02 00:17:58 -05:00
bors[bot]
1376e15b78
Merge #2027 #2057
2027: Update to bitflags 2.2.1. r=asomers a=qwandor

This is a new major version and requires some code changes.

2057: Haiku: `speed_t` is defined as `u8` for 32 and 64 bit systems r=asomers a=nielx

This fixes the build on 32 bit Haiku systems.

Co-authored-by: Andrew Walbran <qwandor@google.com>
Co-authored-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2023-06-29 23:25:58 +00:00
bors[bot]
2a7ea3acad
Merge #2051
2051: Update CHANGELOG for patch release 0.26.2 r=asomers a=asomers

[skip ci]

Co-authored-by: Alan Somers <asomers@gmail.com>
2023-06-29 23:02:25 +00:00
bors[bot]
728609c96b
Merge #2061
2061: For invalid IP address conversions with future Rust versions r=asomers a=asomers

Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr are wrappers around the C types (though for now at least, they are identical on all platforms I'm aware of).  So do the conversions explicitly instead of transmuting.

Fixes #2053

Co-authored-by: Alan Somers <asomers@gmail.com>
2023-06-29 22:54:08 +00:00
Alan Somers
1546857f8c For invalid IP address conversions with future Rust versions
Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr
are wrappers around the C types (though for now at least, they are
identical on all platforms I'm aware of).  So do the conversions
explicitly instead of transmuting.

Fixes #2053
2023-06-27 21:26:18 -06:00
bors[bot]
9a3010b62b
Merge #2062
2062: Disable the doc test for sys::personality::personality on aarch64 r=asomers a=asomers

It's failing in CI, and we don't yet know why.  Possibly the cloud provider just turned on seccomp.

Issue #2060

Co-authored-by: Alan Somers <asomers@gmail.com>
2023-06-28 01:55:51 +00:00
Alan Somers
fccc89f9f0 Disable the doc test for sys::personality::personality on aarch64
It's failing in CI, and we don't yet know why.  Possibly the cloud
provider just turned on seccomp.

Issue #2060
2023-06-27 18:00:40 -06:00
Niels Sascha Reedijk
e63dd8fa59 Haiku: speed_t is defined as u8 for 32 and 64 bit systems 2023-06-17 15:04:46 +00:00
bors[bot]
89b4976fdd
Merge #2052
2052: Fix CI with the latest rustup r=asomers a=asomers



Co-authored-by: Alan Somers <asomers@gmail.com>
Co-authored-by: Ben Kimock <kimockb@gmail.com>
2023-06-06 01:03:32 +00:00
Ben Kimock
57cdbed0ab Clippy cleanup:
fix the new clippy::non-minimal-cfg lint
2023-06-05 18:11:07 -06:00
Alan Somers
9b33131696 Fix CI with the latest Rustup
The latest Rustup does not allow the toolchain specification to be
blank, which we were using.  Fix it by ensuring that only one toolchain
is ever installed in a given task, so we won't need to use the
+$TOOLCHAIN with cargo.
2023-06-05 18:08:04 -06:00
Alan Somers
3147e67b67 Update CHANGELOG for patch release 0.26.2
[skip ci]
2023-06-05 16:59:13 -06:00
Chris Spencer
d66c0c1d5a Enable additional socket timestamping flags 2023-06-02 16:04:23 +01:00