Age | Commit message (Collapse) | Author |
|
1303: Renable the ScmTimestamp test on FreeBSD i386 r=posborne a=asomers
The relevant bug was fixed in 11.3-RELEASE
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
Fix deprecation warning from libc update.
|
|
The relevant bug was fixed in 11.3-RELEASE
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039
|
|
Currently the SockProtocol enum is rather scarce. This commit adds the Netlink protocols
defined in netlink(7) to the SockProtocol enum allowing us to use the Nix socket library for
more indepth Netlink work
|
|
The commit https://github.com/nix-rust/nix/pull/1222 added the very
useful Ipv4PktInfo to allow `sendmsg` to define the origin of the ip.
Unfortunattely, it didn't add the struct to Android target devices as
well. This commit adds the `target_os = "android"` checks on the same
place to allow the compilation to work for the following archs tested:
- `cross build --target aarch64-linux-android`
- `cross build --target x86_64-linux-android`
- `cross build --target armv7-linux-androideabi`
Also introduces iOS to allow using on libs for those platforms
|
|
It was only marked unsafe because it did a pointer cast, but that
particular pointer cast is always allowed by C.
|
|
|
|
It already fully validated its arguments, so there's no need for it to
be `unsafe`.
|
|
This adds Ipv4PacketInfo and Ipv6PacketInfo to ControlMessage,
allowing these to be used with sendmsg/sendmmsg.
This change contains the following squashed commits:
Add Ipv{4,6}PacketInfo to ControlMessage.
Add documentation links to Ipv{4,6}PacketInfo
Add changelog entry for Ipv{4,6}PacketInfo
Add link to PR in the Changelog.
Add extra build environments.
Add tests for Ipv{4,6}PacketInfo.
Swap #[test] and #[cfg]
The CI appears to be running the test, even though it's not cfg'd for
that platform. I _think_ this might be due to these being in the wrong
order. So lets try swapping them.
s/freebsd/netbsd/ for Ipv4PacketInfo
netbsd supports in_pktinfo, not freebsd.
Fix the cfg for Ipv{4,6}PacketInfo usage.
Ah, I see what I did wrong. I had fixed the definitions, but I had the
wrong cfg() in the usage. This has the usage match the definitions.
Change SOL_IPV6 to IPPROTO_IPV6.
FreeBSD doesn't have SOL_IPV6, but does have IPPROTO_IPV6, and the two
constants are defined as being equal. So change to use IPPROTO_IPV6.
Skip Ipv6PacketInfo test if v6 is not available.
If IPv6 is not available, then when we try and bind to ip6-localhost,
we'll get a EADDRNOTAVAIL, so skip the test.
This should mean that the test will run on any machine that has a v6
loopback address.
More architecture cfg() fixes.
These all need to be the same, and they were not. Make them them all
the same. Attempt III.
Fix up mismatched cfg's again.
Take IV. Make sure the cfg's that use a enum variant match the enum
definition.
|
|
|
|
sendmmsg() / recvmmsg() in #1208.
In #1208, sendmmsg() / recvmmsg() were added, but OpenBSD(who doesn't support these)
was included on the list of allowed operating systems for sendmmsg() related things.
This broke the build on OpenBSD.
For more Rust-world examples, see: https://github.com/rust-lang/libc/commit/6f6297301d49ff67b8ca044d651f36a56950298c
|
|
repr(transparent) is required in order to safely cast between an FFI
type and its NewType. This commit applies that attribute to PollFd,
EpollEvent, IpMembershipRequest, Ipv6MembershipRequest, TimeVal, and
IoVec.
Fixes #1241
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This eliminates one of the last remaining uninitialized memory accesses
in Nix.
Fixes #1142
|
|
recvfrom(2) only returns the sender's address for protocols that provide
it. Usually, that means it returns the sender's address for datagram
sockets but not for stream sockets.
Fixes #1144
|
|
Because of the use of MaybeUninit::uninit, the padding fields in msghdr,
which only present on musl builds, are not initialized. Causing garbage
data to be sent to the kernel. This change ensures the paddings are
always zeroed.
|
|
`assert_eq!` gives more debug info when the test fails by default than
`assert!`. This should help make debugging easier.
|
|
Only two instances remain:
* For the deprecated sys::socket::CmsgSpace::new. We should probably
just remove that method.
* For sys::termios::Termios::default_uninit. This will require some
more thought.
Fixes #1096
|
|
|
|
It was leftover from internal churn during PR #1020.
|
|
|
|
|
|
|
|
1095: Fix warnings on Rust 1.37.0 r=asomers a=asomers
* Replace obsolete range syntax "..." with inclusive range "..="
* Use dyn Trait syntax instead of Box<Trait>
* Raise MSRV to 1.27.0 (for dyn Trait syntax)
* Test with nightly again
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
* Replace obsolete range syntax "..." with inclusive range "..="
* Use dyn Trait syntax instead of Box<Trait>
* Raise MSRV to 1.27.0 (for dyn Trait syntax)
* Raise MSRV to 1.31.0 (because of rand)
tempfile pulls in rand, and rand pulls in fuchsia-cprng, which requires
1.31.0. Why rand pulls in fuchsia-cprng I don't know. It's specified
as a target-specific dependency, but Cargo tries to build it anyway
(only on Linux, not on FreeBSD or OSX). A bug in Cargo 1.27.0?
|
|
This patch adds AF_VSOCK support to AddressFamily in order to use
VSOCK socket.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all
traits are supported by all types, which is why many are missing
some.
|
|
MSG_WAITALL can be useful with recv() to wait the full amount of data
requested.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
received using recvmsg.
|
|
|
|
This was an oversight from PR #1002
|
|
On some platforms the alignment of cmsg_data could be less than the
alignment of the messages that it contains. That led to unaligned
reads
on those platforms. This change fixes the issue by always copying the
message contents into aligned objects. The change is not 100%
backwards
compatible when using recvmsg. Users may have to replace code like
this:
```rust
if let ControlMessage::ScmRights(&fds) = cmsg {
```
with this:
```rust
if let ControlMessageOwned::ScmRights(fds) = cmsg {
```
Fixes #999
|
|
CmsgSpace had three problems:
1) It would oversize buffers that expect multiple control messages
2) It didn't use the libc CMSG_SPACE(3) macro, so it might actually
undersize a buffer for a single control message.
3) It could do bad things on drop, if you instantiate it with a type
that implements Drop (which none of the currently supported
ControlMessage types do).
Fixes #994
|
|
There were two problems:
1) It would always return Ok, even on error
2) It could panic if there was an error, because
sockaddr_storage_to_addr would be called on uninitialized memory.
|
|
Our hand-rolled logic had subtle alignment bugs that caused
test_scm_rights to fail on OpenBSD (and probably could cause problems on
other platforms too). Using cmsg(3) is much cleaner, shorter, and more
portable. No user-visible changes.
|
|
Include IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd.
|
|
The old test made assumptions about the responsiveness of the test
environment. The new test does not, and it's simpler too.
|
|
993: Don't reference packed structs. r=asomers a=pusateri
Fixes #992.
Don't merge this yet. I have more testing to do. I just am pushing it up for others.
Co-authored-by: Tom Pusateri <pusateri@bangj.com>
|
|
990: Add cmsg PKTINFO for IPv4 and IPv6. r=asomers a=pusateri
Replaces #891 and attempts to address all previous concerns.
Co-authored-by: Tom Pusateri <pusateri@bangj.com>
|
|
Some tests have been disabled and will need further review.
|
|
ignore pktinfo tests on qemu mips,mips64,powerpc64
Original work by @mcginty.
|
|
try! is not available in Rust 2018
|
|
Makes it easier for newcomers :)
|
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|